Skip to content

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