mattmazzola / react-simple-auth

Authentication library for React based on Ember-Simple-Auth
MIT License
56 stars 15 forks source link

Restoring session not working #1

Closed TimDorand closed 6 years ago

TimDorand commented 6 years ago

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.

TimDorand commented 6 years ago

Issue was in

mattmazzola commented 6 years ago

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.