lorenzh / fut-api

Ultimate Team API - FIFA 16 - unofficial
MIT License
53 stars 12 forks source link

Possible to save EA-Session #16

Open derSoerrn95 opened 7 years ago

derSoerrn95 commented 7 years ago

Hi,

how can I save the login-details, that I don´t need to login every time i'll restart the server?

I'm using these options:

`var options = { saveCookie: true, saveCookiePath: "cookies.json", loadCookieFromSavePath: true }

var apiClient = new futapi(options);`

Is there a hidden method, which I´m supposed to call?

stefvw93 commented 7 years ago

LloadCookieFromSavePath should be the same as saveCookiePath. Please look at the docs before opening an issue! :)

BenjaminPaap commented 7 years ago

loadCookieFromSavePath should be a boolean value. I'm using nearly exact the same options but I call the login method at least once. It will check itself, if it has to make a fresh login or can use the cookie, but as far as I know you have to call login at least once because EA implemented some security mechanisms which you have to go through first.

derSoerrn95 commented 7 years ago

Thanks. I'll try 'loadCookieFromSavePath' with a String after work.

@BenjaminPaap, how can you use the login-method once? I'm new to NodeJS (so maybe sorry for the question) and my application is running on a Debian server. I don't know how I can wait in the 'next' method for another client request, respectively call the next function from another request (outside the firstone).

My login works something like this:

1) Sending login request with email and password 2) using login-function with random code and create Session user with Email and pw 3) sending another request with two factor code an serect answer 4) get email/pw from first request and code/secret from the second one 5) using login-function again

gregbarcza commented 7 years ago

@derSoerrn95 in the fork of this repo (https://github.com/futjs/fut-api) there is a loginCached method which only using tokens fetched previously by login method. I think thats what you searching for.