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

Protected route created #657

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JunaidBukhari
Copy link

Resolves #650

LoginDialog: When the user logs in successfully, an access token is generated using base64 encoding of the user's email. This token is stored in localStorage.

ProtectedRoute: The isAuthenticated function checks for the presence and validity of the access token in localStorage. If the token matches the expected value, the user is allowed to access the protected route; otherwise, they are redirected to the login page.

This example uses base64 encoding for simplicity, but in a real-world application, you should use a more secure method for generating and validating tokens, such as JWT (JSON Web Tokens).

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.

can open dashboard without login?
1 participant