-
Notifications
You must be signed in to change notification settings - Fork 262
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
Persist credentials #50
Persist credentials #50
Conversation
…ded an option to do so if needed
This includes the fixes made in #48. |
The PR will also fixes #56 . |
I'm using your fork with general success. Thanks for the work. The only problem I've found right now is that I'll see if I can get this working... |
It should not break server-side rendering. I meant that the solution I made in this pr is not the most elegant one and might be a good idea to make totally separate configuration functions for the different configuration types (client and server-side). |
@lynndylanhurley FYI I have implemented a Semantic-UI theme on top of @jlonardi's fork The fork is working all the way up to dealing with the emailed out links; once it redirects in |
This should fix the issues #47 and #11.
The main problem seems to be that the configuration is made with the assumption that it is used with serverside rendering. The idea seems to be that if the server invalidates credentials via TokenBridge the session would be destroyed. Since TokenBridge is not used on client-only usage the initialCredentials are allways undefined causing the call of destroying the session.
If I understood correctly from this #7 (comment), there will be full support for client-only usage. Currently client-only usage seems to work at some extend and with this fix it becomes more usable when every page reload is not anymore clearing the sessions. As said here #23 (comment) the real fix is to make a completely different configuration for client-only usage but meanwhile this should make the library a bit more usable client-only.
I noticed also that it was possible to pass
storage: 'localStorage'
with the settings to get the the persisting to happen in to the localStorage. This was an undocumented feature and was not sure if there is something that doesn't work when used. So far couldn't find any difference with cookies vs localstorage persiting.This fixes also a bug where fetch was called with the saved headers as parameter instead of the api-url.
Added also an extra option so it could be possible to configure the and run the configure so that it is possible to flush credentials with client only usage.