Tampermonkey script automating login encountered a POST 404 error

REVISION (click here *)

I developed a basic auto login script using Tampermonkey for

// ==UserScript==
// @name         7Mind User Login Website
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://app.7mind.de/*
// ==/UserScript== 

let emailAddress = document.getElementsByName('email');
emailAddress[1].value = "x@y"
let password = document.getElementsByName('password');
password[1].value = "pass"
let loginButton = document.getElementsByName('submit');
loginButton[0].click();

When using this script, I encountered the following error in Chrome console:

POST https://api.7mind.de/v1/login 404

Even trying to target the login button by class resulted in the same issue:

let loginButton = document.getElementsByClassName("_2N3ybblop__YQd82Xe-Uw1");

Despite my efforts, the script failed to insert the credentials on the login page.

*I noticed that if I omit the line loginButton[0].click(), the credentials are successfully added but logging in manually still throws an error.

Many online resources suggest that such straightforward login scripts should function properly.

Could this be a new security measure in Chrome preventing my login automation?

Answer №1

The server's API error message shows a 404 for the reason of "Incorrect email or password". To investigate further, review the Network Tab in the Developer Tools of your web browser.

Additional information: Consider following this suggested method outlined at github.com/facebook/react/issues/10135#issuecomment-314441175. This is important because when utilizing a framework such as ReactJS, modifying the element value using JavaScript does not automatically update the React component's state. As a result, any changes made may be lost upon the component refreshing, while the outdated data is sent to the server instead.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having trouble with .animate() function?

Struggling to animate the position of my background image $(function() { $('#nav1').bind('click',function(event){ $('ul.nav').stop().animate({backgroundPosition: 'right top'}, 1000); }); $(function() { ...

When opening a dialog at the bottom of the page, the window will automatically scroll to the top

I'm encountering an issue with a page that has a width exceeding 100% (2000px). Whenever I click to display a dialog from a button located at the end of the horizontal page, the window automatically scrolls back to the beginning of the page before sho ...

Getting the value of a hidden input field within a div by accessing the event.target that initiated the event in JavaScript

I am working with a set of li elements, each containing specific child elements structured like this: <li class="list"> <!--Parent--> <input type="hidden" id="id" value="3"> <!--Child 1--> <div class="cd-1">....</div ...

Struggling to pass Chai tests with Node and Express.js when trying to handle POST requests

Working through a Chai testing exercise and struggling to pass the POST route tests. Encountering two specific errors: 1) Todo API: POST /v1/todos Issue with creating and returning new todo using valid data: Header 'location' should ...

Is it possible for jquery to run an entire HTML file using ajax?

Based on information from a discussion on Stack Overflow, it seems that I can utilize the jquery getScript() method to run a remote JavaScript file loaded via Ajax. However, in my specific scenario, the script file is located within an HTML file. Is ther ...

Is it possible to configure the async.retry method to retry even upon successful queries, depending on a specific condition?

Currently, I am delving into the node.js async module and wondering if it's possible to modify the behavior of the async.retry method. Specifically, I'd like it to retry even on successful operations but halt based on a certain condition or respo ...

Obtain the current user's Windows username without relying on the ActiveX object

Is there a way to retrieve a client's Windows username in ASP.NET when hosted on a remote server without using an ActiveX object? I tried the following code: Response.Write("HttpContext.Current.Request.LogonUserIdentity.Name " & HttpContext.Cur ...

Is there a way to dynamically update text using javascript on a daily basis?

I am currently developing a script to showcase different content and images every day. While I have successfully implemented the image loop to display a new picture daily, I need assistance in achieving the same functionality for the title. My aim is to c ...

Ways to transmit data multiple times within a single request

I'm currently developing an app using Nodejs and express, where orders can be placed for specific products. In this application, when an order is received, it is saved in the database and a PDF receipt is generated immediately. However, since generati ...

Guide on creating a Sequelize query to retrieve all tasks linked to a specific user_id

I'm currently developing my first to-do list application using node express ejs and sequelize with sqlite Below is my sqlite.js file which contains the database schemas: const Sequelize = require("sequelize"); const sequelize = new Sequelize({ dia ...

Implementing dynamic class bindings with Vue.js using v-for

I am currently using a v-for loop in Vue.js to create a list of items populated with data from an API. Here is an example of the items array: items: [ { foo: 'something', number: 60 }, { foo: 'anything', ...

Failed to convert value to a string

I'm dealing with a frustrating issue and I just can't seem to figure it out. The error message I'm getting is Cast to string failed for value "{}" at path "post". { "confirmation": "fail", "message": { "message": "Cast to string fai ...

Calendar: Display upcoming dates within the next week starting from the current week

Hey there! I have a calendar that includes next and previous buttons. When the user clicks on the next button, the schedule for the upcoming week will be displayed. However, if the user clicks again, nothing happens. My goal is to only show dates for the n ...

Creating intricate mazes using canvas drawing techniques

I recently developed a maze generator as a personal project utilizing a graph. While the generation logic works perfectly, I am facing challenges when it comes to rendering the maze. In my approach, each cell is represented by an array of 4 edges where the ...

The correct method for creating an external JSON file

As I browse through numerous JSON tutorials online, including those on STO, I find myself in a state of confusion when it comes to determining the right approach for writing an external JSON file. I have come across various examples such as: (although Ad ...

Create a nested array of subcategories within an array object

Currently, I am working on integrating Django Rest and Angular. The JSON array received from the server includes category and subcategory values. My goal is to organize the data such that each category has its related subcategories stored as an array withi ...

Combining two arrays with varying lengths based on their values

Seeking assistance with a programming task that is straightforward yet challenging for me. There are two arrays: one long and one short. var arrayShort = [ { id: 'A', name: 'first' },{ id: 'B', name: &ap ...

What steps can I take to minify my code using react-create-app?

Currently, I am facing an issue with minifying my code on the server. Despite running npm run build, which is supposed to handle all the minifying processes (as shown here: https://i.stack.imgur.com/wjpd7.png), I still see the unminified code when accessin ...

What is the reason behind the shifting behavior of e.currentTarget when using event delegation in jQuery?

Click here for the code snippet <div id="container"> <button id="foo">Foo button</button> <button id="bar">Bar button</button> </div> $('#container').on('click', function(e) { var targ ...

Identifying numerous array positions within a canvas

Greetings fellow developers, Today, I have an inquiry regarding a project I am working on, akin to a Tower Defense game created using canvas. I am facing a challenge in detecting multiple circles in one coordinate. Here's an excerpt of my current dil ...