fix(auth-info): autoInfo now updates when the authInfo is originally falsy#75
Merged
andrew-propelauth merged 2 commits intoPropelAuth:mainfrom Mar 4, 2025
Merged
fix(auth-info): autoInfo now updates when the authInfo is originally falsy#75andrew-propelauth merged 2 commits intoPropelAuth:mainfrom
andrew-propelauth merged 2 commits intoPropelAuth:mainfrom
Conversation
…falsy In scenarios where the user starts off as logged out, and attempts to refresh the auth info manually, no changes to the store state will take place because the _state.authInfo will cause the check to fail
andrew-propelauth
approved these changes
Mar 4, 2025
Contributor
andrew-propelauth
left a comment
There was a problem hiding this comment.
Thanks for the fix, appreciate it!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In scenarios where the user starts off as logged out, and attempts to refresh the auth info manually, no changes to the store state will take place because
_state.authInfowill already benulland will cause the check to fail.This particular scenario occurs when leveraging the new ui based hooks. It goes as follows:
emailPasswordLogincall fromuseAuthFrontendApis.refreshAuthInfofunction fromuseAuthInfois manually executeduser&accessTokenremain asnull, even though the login flow has completed, and regardless if calls to the/refresh_tokenendpoint succeeedContext: This happens because the flow that I'm currently trying to implement involves keeping the user on the root route before redirecting them to a new page, as there is some basic user-related information we'd like to show before redirecting.
I understand this check was originally put in place in this commit, but to compensate for it, optional chaining is put on both the
_state&authInfoobjects.