redirect after successful register and login #1840
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix: add redirect after successful register and login (#1835)
Description:
This PR fixes issue #1835, where after successful registration, the user was not automatically redirected to the login page, and after successful login, the user was not redirected to the homepage.
Changes Made:
Added redirect logic after successful registration to navigate users directly to the login page.
Added redirect logic after successful login to navigate users directly to the homepage.
Ensured that once logged in, the user can see their profile and has options to edit profile and logout.
Before:
After registration → stayed on registration page.
After login → stayed on login page until manually navigating.
After:
After registration → automatically redirected to login page.
After login → automatically redirected to homepage.
Untitled.design.1.mp4
Steps to Test:
Register a new account.
Verify that you are redirected to the login page automatically.
Login with your credentials.
Verify that you are redirected to the homepage automatically.
Check that profile, edit profile, and logout features are accessible.
Linked Issue:
Closes #1835
Checklist:
Redirection tested for both register and login.
No console errors after changes.
Profile section visible after login.
Logout and edit profile working as expected.