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

feat(client): persist access token #359

Merged
merged 1 commit into from
Jul 20, 2022
Merged

Conversation

wangsijie
Copy link
Contributor

Summary

Add an optional feature: persist access token to storage.

Before this, access token is only saved in instance property, when creating a new instance, it doesn't have any access token, but it can reuse refresh token from storage, and then grant a new access token. This is fine for SPA, since it only have an instance when the user navigates between pages. But in other circumstances, especially in traditional app when LogtoClient is run in server side, it will create a new instance each time when receiving a request, that means there will be so many instances sharing the same storage. Then, it'll be good to reuse access token.

Testing

UTs.

@wangsijie wangsijie enabled auto-merge (squash) July 20, 2022 04:51
@wangsijie wangsijie merged commit 10fb181 into master Jul 20, 2022
@wangsijie wangsijie deleted the sijie-persist-access-token branch July 20, 2022 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants