Flash-Fathom-AI icon indicating copy to clipboard operation
Flash-Fathom-AI copied to clipboard

Add logout confirmation dialog

Open umaima06 opened this issue 1 year ago • 2 comments

Add Logout Confirmation Dialog

Current Problem Currently, logout is handled entirely by Clerk's built-in UserButton component in src/components/Navbar.tsx. When users click sign out, they are logged out instantly without confirmation, which can cause accidental logouts.

What Needs to Be Done Since the app uses Clerk's UserButton with afterSignOutUrl="/", there are two approaches:

Option A (Recommended): Use Clerk's <UserButton.MenuItems> to add a custom "Sign Out" menu item that triggers a confirmation dialog before calling signOut() from @clerk/nextjs.

Option B: Replace UserButton with a custom dropdown that includes a logout option with a confirmation modal using shadcn/ui AlertDialog.

Implementation Details

  1. Create a confirmation dialog component using shadcn/ui AlertDialog
  2. Dialog should show: "Are you sure you want to log out?"
  3. Two buttons: "Cancel" (closes dialog) and "Confirm" (calls Clerk signOut)
  4. Match the app's existing dark/light theme styling

Files to Modify

  • src/components/Navbar.tsx — UserButton section (line ~160)
  • May need new: src/components/LogoutDialog.tsx

Acceptance Criteria

  • [ ] Clicking logout shows a confirmation dialog
  • [ ] "Cancel" keeps user logged in
  • [ ] "Confirm" signs the user out and redirects to homepage
  • [ ] Dialog supports dark and light mode
  • [ ] Works on mobile and desktop

umaima06 avatar Sep 13 '25 17:09 umaima06

@Suraj-kumar00 kindly assign me this issue under GSSoC '25 and suitable 'level' and other labels.

umaima06 avatar Sep 13 '25 17:09 umaima06

I don't think this is good. can you check existing issue?

Suraj-kumar00 avatar Sep 14 '25 06:09 Suraj-kumar00