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

Redirect user after login #154

Open
kgilles opened this issue May 17, 2024 · 2 comments
Open

Redirect user after login #154

kgilles opened this issue May 17, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kgilles
Copy link
Member

kgilles commented May 17, 2024

If a logged out user tries to access a restricted page, such as the post-creation page, they will instead be directed to the login page. When this happens we want to keep track of the page the user attempted to access, and direct them there automatically after they successfully log in.

For example

  1. Logged out user tries to navigate to /p to create a post
  2. They're instead taken to /login
  3. The user logs in
  4. They're automatically taken to /p
@kgilles kgilles added enhancement New feature or request good first issue Good for newcomers labels May 17, 2024
@kgilles kgilles moved this to 🔖 Ready in Sublinks Frontend May 17, 2024
@kgilles kgilles moved this from 🔖 Ready to 🏗 In progress in Sublinks Frontend Jun 24, 2024
@chasingtheflow
Copy link
Contributor

Did you envision this being resolved by adding middleware or do you want to add the checks directly into the protected hoc routes (forget the exact name of the component)?

@kgilles
Copy link
Member Author

kgilles commented Jun 24, 2024

Did you envision this being resolved by adding middleware or do you want to add the checks directly into the protected hoc routes (forget the exact name of the component)?

I believe we can add the referred path as a query parameter to the login page URL via the restricted page component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants