Skip to content

fix(admin): make header logout button functional#213

Open
SagitQuark wants to merge 1 commit into
rdodiya:gssoc_developfrom
SagitQuark:fix/header-logout
Open

fix(admin): make header logout button functional#213
SagitQuark wants to merge 1 commit into
rdodiya:gssoc_developfrom
SagitQuark:fix/header-logout

Conversation

@SagitQuark
Copy link
Copy Markdown
Contributor

Issue Link

Closes #209

Changes Made

  • Added a handleLogout function in Header.jsx
  • Connected the logout handler to the "Sign Out" button in the admin profile dropdown
  • Removed accessToken from localStorage on logout
  • Redirected users to /login after signing out

Type of Change

  • Bug fix

Testing Performed

  • Verified logout removes accessToken from browser localStorage
  • Verified user is redirected to /login after clicking "Sign Out"
  • Verified protected admin routes are inaccessible after logout
  • Checked for console errors during logout flow

UI Changes

  • No visual/UI changes
  • "Sign Out" button is now functional

Additional Notes

Copy link
Copy Markdown
Contributor

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

Fixes the admin header profile dropdown “Sign Out” action so it actually performs a logout flow and redirects users back to the login screen, addressing Issue #209.

Changes:

  • Added a handleLogout function in the admin Header component.
  • Wired the “Sign Out” dropdown button to call the new logout handler.
  • Clears accessToken from localStorage and navigates to /login.

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

Comment on lines +41 to +45
// Handle user logout
const handleLogout = () => {
localStorage.removeItem('accessToken');
navigate('/login');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "Sign Out" action in admin profile dropdown is currently non functional.

3 participants