Added feature that the logged in user is displayed with logout button… #1162
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.
Implement Persisted User Login State on Page Refresh
As per the code in docs, after logging in, if we refresh the page then the loggedInUser state is set to null as default and it will be changed only when the login function is called, but the user is still logged in. So I have integrated a feature that if the user is logged in then the logged-in component will be displayed.
What does this PR do?
This PR implements a mechanism to persist the user's login state across page refreshes. Previously, the loggedInUser state was set to null on page reload and only updated when the login function was called, even though the user was still logged in. With this change, if the user is logged in, the logged-in component will be displayed immediately after a page refresh.
Test Plan
To verify the changes:
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
Yes, I have read the Contributing Guidelines on issues.