fix: correct sidebar logout behavior#417
Merged
Merged
Conversation
Contributor
Author
|
Sir /Mam , |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📝 Pull Request Description
Related Issue
Closes #379
Summary
Fixed the sidebar Logout functionality to ensure users are logged out correctly and redirected to the landing page instead of encountering a Not Found page.
Changes made:
-Updated the sidebar logout button to use the same logout flow as the profile logout button.
-Added a backend logout API call before clearing user data.Cleared both localStorage and sessionStorage after logout.
-Cleared the authenticated user from the context.
-Redirected users to the landing page (/) after successful logout.
Type of Change
How Has This Been Tested?
-Logged into the application using valid credentials.
-Clicked the Logout button from the sidebar.
-Verified that the user was logged out successfully.
-Confirmed that the application redirected to the landing page without showing a "Not Found" page.
Screenshots (if applicable)
Before: it shows page not found 404 error

After : it logs out succesfully


Checklist