user login api request without callback
Unanswered
Oak saucer gall posted this in #help-forum
Oak saucer gallOP
hey there,
I am writing an extension for a game called Grepolis. In order for it to work i need to be able to call protected api routes from a userscript that is running on a page.
Currently i have managed to login a user on my application itself which works without a hitch. In order for me to store a session in the cookies / localstorage i need to login the user via an api call. This is what i am currently doing.
First off im calling the
Any advice? id be happy to supply some of my configuration code if needed.
I am writing an extension for a game called Grepolis. In order for it to work i need to be able to call protected api routes from a userscript that is running on a page.
Currently i have managed to login a user on my application itself which works without a hitch. In order for me to store a session in the cookies / localstorage i need to login the user via an api call. This is what i am currently doing.
First off im calling the
GET http://localhost:3000/api/auth/csrf to get the token to include in the request. When i receive the token im calling the next endpoint which is POST http://localhost:3000/api/auth/callback/credentials With content-Type being application/json, and the data being email,pw and the csrftoken that i received from the previous request. The calls work the only issue that i am running into is that it want to redirect me to the homepage of my application which i do not need. i just need the cookies returned and not the page.Any advice? id be happy to supply some of my configuration code if needed.