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

Added feature that the logged in user is displayed with logout button… #1162

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

shivanshukarn
Copy link

@shivanshukarn shivanshukarn commented Jul 29, 2024

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:

  1. Log in to the application.
  2. Refresh the page.
  3. Confirm that the logged-in component is displayed immediately after the refresh, indicating that the user's login state has been persisted.

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.

… instead after reloading

As per the code in docs, after logging in, if we refresh the page then the loggedInUser state is set on 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 an feature that if the user is logged in then the logged in component will be displayed.
@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Jul 30, 2024

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2024-08-26 16:30:52 CET

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Aug 3, 2024

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2024-08-03 06:32:53 CET

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.

1 participant