[Deprecated] Instructions on how to automatically login to duelingbook without manually typing in your username/password

If you have a suggestion for the site, create a topic here and telll us about it
Christen57
User avatar
Posts: 2033
Joined: Sun May 07, 2017 10:37 pm
Reputation: 182
Location: New York, United States of America

[Deprecated] Instructions on how to automatically login to duelingbook without manually typing in your username/password

Post #1 by Christen57 » Tue May 25, 2021 5:55 pm

Duelingbook automatically remembers login information and allows players to login from browsers, that they previously used to log in, without having to re-enter their passwords. This feature existed before but never worked properly due to a bug.

As of August 2023, the bug seems to have now been fixed, making the method in this guide for automatically logging in obsolete. This guide will remain archived. The original title of this thread was "Instructions on how to automatically login to duelingbook without having to manually type your username and password".


Currently on duelingbook, when you want to login, you have to manually type your username and password in these little white boxes each time.

Image

This can be a very tedious process, especially if you have a long/complex username/password that uses a combination of letters, numbers, and symbols, or if you're just trying to quickly log back in after being disconnected or timed out.

Fortunately, thanks to javascript, I can now make it so that instead of manually typing in my username and password each time, I can login to my account with just the click of a button, or in this case, the click of a javascript bookmark.

Image

You do need to make sure javascript is enabled and allowed on your browser and on duelingbook, and make sure you refresh/reload the page if necessary.

Image

Here is the javascript code for the bookmark will allow you to login to duelingbook without having to manually type in your username and password.

Code: Select all

javascript:var YourUsername = "InsertYourUsernameHere";
var YourPassword = "InsertYourPasswordHere";
function performLogin() {
   if (logging_in) {
      return;
   }
   logging_in = true;
   var fd = new FormData();
   fd.append("username", YourUsername);
   fd.append("password", YourPassword);
   fd.append("remember_me", ~~false);
   fd.append("db_id", db_id);
   fd.append("session", session_id);
   fd.append("browser", getBrowser());
   
   var xhr = new XMLHttpRequest();
   xhr.open("POST", URL_START + "php-scripts/login-user.php", true);
   xhr.onreadystatechange = function() {
      if (xhr.readyState == 4 && xhr.status == 200) {
         performLoginResponse(xhr.responseText);
      }
   }
   ;xhr.onerror = ioError;
   xhr.send(fd);
   showDim();
}
performLogin();


To make this code work, we need to copy and paste it onto something like notepad, where we can easily edit it.

Image

At the very top where it says InsertYourUsernameHere, we're going to replace that with whatever our username is. Since my username is Christen57, I'm going to replace InsertYourUsernameHere with Christen57.

Image

Right below that, where is says InsertYourPasswordHere, we're going to replace that with whatever our password is. For this demonstration, I'm going to pretend our password is abcd1234.

Image

After we replace InsertYourUsernameHere with our username and replace InsertYourPasswordHere with our password, we're going select everything and copy it, or if we're on windows 10, we can instead input CTRL+A then CTRL+C on our keyboard to select everything and copy it automatically.

Image

After that, we're going to create a new javascript bookmark, name it whatever we want (I will be naming mine "auto login"), then in the URL, Address, or Location box, whatever the browser calls it, we will paste our copied code that had our username and password. After that, we will save our bookmark.

Image

We will go to duelingbook, and then instead of manually typing our username and password in the boxes, we will click our newly created bookmark. If both the username as password are correct, duelingbook will accept them and log us in automatically.

Image

As you can see, duelingbook rejects the fake password abcd1234 because it requires the actual password for the account in order for the automatic login to be successful, so you must must use your actual username and password for logging in, not the username and password I used for this demonstration, but it does work when both the username and password are correct, and I've tested it on Vivaldi, Google Chrome, and Firefox.

Return to “Suggestions”

Who is online

Users browsing this forum: No registered users and 148 guests