Skip to content

MXWAR-45 :- fix signout issue.#40

Open
Omar-Nabil2 wants to merge 1 commit intoopenMF:devfrom
Omar-Nabil2:signout
Open

MXWAR-45 :- fix signout issue.#40
Omar-Nabil2 wants to merge 1 commit intoopenMF:devfrom
Omar-Nabil2:signout

Conversation

@Omar-Nabil2
Copy link

Description

Sign out buttons in navbar and sidebar didn't work properly: navbar caused redirect loops, sidebar had no functionality at all. I have integrated Redux logout action in both components properly. Imported useDispatch, logout action, and AppDispatch type. Modified navbar's handleNavigate to dispatch logout when navigating to login page. Created handleLogout function in sidebar that dispatches logout then navigates to login. This properly clears both Redux state and localStorage token, preventing redirect loops.

Screenshots, if any

before

before.mp4

after

after.mp4

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • [ x] If you have multiple commits please combine them into one commit by squashing them.

  • Read and understood the contribution guidelines at CONTRIBUTING.md.

Copilot AI review requested due to automatic review settings January 31, 2026 11:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes non-functional sign out buttons in the navbar and sidebar by properly integrating Redux logout functionality. Previously, the navbar's sign out caused redirect loops and the sidebar's sign out button had no functionality.

Changes:

  • Added Redux logout action integration to both AppSidebar and MfNavbar components
  • Changed the sign out path from 'signout' (non-existent route) to 'login'
  • Created dedicated logout handler in sidebar that clears Redux state and localStorage token before navigation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/components/custom/sidebar/AppSidebar.tsx Added Redux dispatch hook, logout action import, and handleLogout function with onClick handler for LogOut icon
src/components/custom/navbar/MfNavbar.tsx Added Redux dispatch hook, logout action import, conditional logout dispatch in handleNavigate, and changed Sign Out path from 'signout' to 'login'

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant