react-oauth icon indicating copy to clipboard operation
react-oauth copied to clipboard

Page refresh removes access_token from gapi api calls.

Open matheusbaumgart opened this issue 1 year ago • 1 comments

I use gapi and when I refresh the page future calls to gapi will not have the authorisation token to it. They all have right after I authenticate, but if I refresh, it's gone. I already tried setting the token after login, no luck.

window.gapi.client.setToken({ access_token: <ACCESS_TOKEN> })

window.gapi.auth.setToken({
    access_token: "YOUR_TOKEN_HERE"
});

Any clues @MomenSherif?

matheusbaumgart avatar Jan 03 '24 10:01 matheusbaumgart

It's more or less expected, I would say. But I would like to rephrase the question. My project is currently in "Test" mode, and the only Javascript origins I specified are "http://localhost" and "http://localhost:5173". From inspecting the cookies, it looks like a session is stored.

Here is the quesion: Is it somehow possible to skip the prompt when reloading the page and get an auth-flow based on the previous session, resulting in a new access token?

stippi2 avatar Jan 28 '24 08:01 stippi2