Mardaneus86 / futwebapp-tampermonkey

TamperMonkey scripts to enhance the FUT 21 Web App - Discontinued
MIT License
192 stars 103 forks source link

[request] auto login if presented Login button, enter credentials in EA login screen #52

Closed fifa2017player closed 6 years ago

fifa2017player commented 7 years ago

Expected behavior:

Sometimes the webapp will show a Login button, when clicking on it, sometimes it will redirect to EA login screen for you to enter username/password. If the script could automate this, it would be great. We could probably enter the credentials in some settings page.

Current behavior:

Give a detailed explanation of the current behavior.

Metadata:

Mardaneus86 commented 7 years ago

Will keep this in mind while creating a single script for all functionalities.

Kyderman commented 7 years ago

Getting past the verification step could be good too (the thing where the move the picture around)

Mardaneus86 commented 7 years ago

Well, if I can find a way around that, I'll probably tell the creators of the captcha software about it. They pay very well for information on automating their captchas :-)

Try if this works for your use case:

// ==UserScript==
// @name        FUT Auto Login
// @version     0.1
// @match       https://www.easports.com/fifa/ultimate-team/web-app/*
// @namespace   https://github.com/Mardaneus86
// ==/UserScript==
(function() {
    'use strict';

    controllers.bootFlow.Login.prototype._onEadpUserInfoFail = function _onEadpUserInfoFail(error) {
        console.log('login failed');
        if (!eadp.identity.getAccessToken()) {
            return; // no access token, so would redirect to EA login
        }

        setTimeout(function() { 
            gNavManager.getCurrentScreenController()._view._controller._viewController._view._btnLogin._triggerActions(enums.Event.TAP, null);
        }, 2000);
  };
})();
fifa2017player commented 7 years ago

Thanks! I will give it a try later.

Is there any chance to also autofill the EA login screen and submit, so that no human interaction is required? Happy to file a separate issue if that is something to be considered separately at a later time too.

Mardaneus86 commented 7 years ago

Should be possible, especially if you have the credentials autofilled by your browser. Don't feel much for storing credentials in the script as it could trigger some security concerns with users.

fifa2017player commented 7 years ago

I just tried installing the script, but it didn't seem to automatically click the login button. I checked the developer console, and didn't see the "login failed". I also updated the @match to allow the language (e.g. en) like what you have in the other scripts: https://www.easports.com/*/fifa/ultimate-team/web-app/*

To clarify, I am referring to this Login button: image

Mardaneus86 commented 7 years ago

Seems to be working here, can you try to debug what's happening?

fifa2017player commented 7 years ago

I tried again, and it worked this time, where after the button is clicked, I get into the webapp without having to go through the EA login screen. Just wondering whether the case when EA login screen is required needs to be handled differently somehow?

I will test this out more. Thanks again for all your help!

fifa2017player commented 6 years ago

It looks like there are two cases:

  1. Clicking the Login button just reloads the webapp without having to go through the EA login screen.
  2. Clicking the Login button goes to the EA login screen.

It looks like 1 is working fine, but not 2. Maybe it is some other event to hook into?

Mardaneus86 commented 6 years ago

2 isn’t handled with this script. It would require the storage of username and password. I don’t know if people feel comfortable providing those credentials.

fifa2017player commented 6 years ago

Even in 2, shouldn't the button be clicked so that the browser navigates to the EA login screen? Users can store credentials using autofill feature of the browser.

Mardaneus86 commented 6 years ago

True, they could. Feel free to change the script to try some stuff out.

I'm currently working on creating a single script with feature flags, so that's getting priority. Will keep this in mind though.

Mardaneus86 commented 6 years ago

Automating the login process to EA isn't in scope of this project, since the focus is on enhancing the web app experience and not on complete automation. I don't want to aid possible trading bots.

Cleaning up the issue list for the FIFA 19 update.