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

Route authenticated users #31

Open
adhilsalim opened this issue May 3, 2023 · 2 comments
Open

Route authenticated users #31

adhilsalim opened this issue May 3, 2023 · 2 comments
Assignees
Labels
duplicate This issue or pull request already exists enhancement New feature or request low priority This issue is not critical and can be addressed at a later time

Comments

@adhilsalim
Copy link
Member

In Main.jsx, I have added a function called onAuthStateChanged().

  • If the user is authenticated, route them to the home page (create a boilerplate), otherwise they will be routed to the sign-in page.

  • If the user is not authenticated and tries to access pages other than the sign-in and sign-up pages, re-routed them to the sign-in page.

  • If the user is authenticated and tries to access the sign-in or sign-up page, re-routed them to the home page.

@adhilsalim adhilsalim added the help wanted Extra attention is needed label May 3, 2023
@adhilsalim
Copy link
Member Author

  • If the user is not authenticated and tries to access pages other than the sign-in and sign-up pages, re-routed them to the sign-in page.

if the user is not authenticated no need to re-route to sign-in or sign-up as we are allowing all to access them.

@adhilsalim adhilsalim added duplicate This issue or pull request already exists enhancement New feature or request low priority This issue is not critical and can be addressed at a later time and removed help wanted Extra attention is needed labels May 7, 2023
@adhilsalim
Copy link
Member Author

in Main.jsx there is funcion called onAuthStateChanged, make use of it to do the following.

if a user is signed in and navigates to /sign or /signup redirect them to /

@AkhilLV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request low priority This issue is not critical and can be addressed at a later time
Projects
None yet
Development

No branches or pull requests

2 participants