fut-api icon indicating copy to clipboard operation
fut-api copied to clipboard

Possible to save EA-Session

Open derSoerrn95 opened this issue 8 years ago • 4 comments

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?

derSoerrn95 avatar Oct 12 '16 16:10 derSoerrn95

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

stefvw93 avatar Oct 17 '16 09:10 stefvw93

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.

BenjaminPaap avatar Oct 17 '16 14:10 BenjaminPaap

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

derSoerrn95 avatar Oct 18 '16 05:10 derSoerrn95

@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.

gregbarcza avatar Oct 18 '16 13:10 gregbarcza