Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a reauthenticate method to expose refresh token use #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tqc
Copy link
Contributor

@tqc tqc commented Oct 9, 2017

This update improves the handling of refresh tokens when using a javascript api rather than the native makeRequest. Somewhat related to #82.

JS code can call reauthenticate to get a new token when a request fails due to an expired token.

I also added saving of the new token after a refresh - previously the new token would be in memory for subsequent makeRequest calls, but the next app startup would return the expired token.

iOS only for now - the android implementation is fairly straightforward, but isn't included as I'm not set up to test that at the moment.

@monolithed
Copy link

@tqc, what about expires_in? How to refresh token without this field?

@tqc
Copy link
Contributor Author

tqc commented Dec 23, 2017

@monolithed An expiry time isn’t needed - if the token you have doesn’t work, try getting a new one. You could check the expiry beforehand if you really wanted to, but it wouldn’t be particularly reliable anyway - there are plenty of other reasons for a token to expire.

@sb8244
Copy link

sb8244 commented Feb 7, 2019

Something like this would be really helpful for me, since I'm having a hard time getting makeRequest to work, but JS fetch would be easy to get setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants