Closed TimDorand closed 6 years ago
Issue was in
/providers/myprovider.ts
const expiration = session.decodedIdToken.iat + session.expireDurationSeconds
session.decodedIdToken.iat
is not defined with my provider
/reducers/userReducer.ts
if (session) { initialState.isLoggedIn = true initialState.id = session.decodedIdToken.oid initialState.name = session.decodedIdToken.name }
session.decodedIdToken.oid
and name
not defined
It seems like you were expecting session.decodedIdToken.iat
to work for Dropbox.
The provider files are custom for the OAuth provider you choose to use. I only wrote one for Microsoft as an example. If you change to Dropbox it's expected not to work.
Likewise for the reducer, the session object returned from a Dropbox provider would be different.
Restoring session not working with other services than microsoft https://medium.com/@mattmazzola/react-simple-auth-react-redux-oauth-2-0-de6ea9df0a63#72b3
I'm using Dropbox provider and as soon as the page is reloaded the Access token is lost.