Skip to content

fix(onboarding): add sign out button to onboarding header #58

Closed

Description

@sourabh-31

What's wrong


When a new user signs up, they are redirected to the onboarding flow at /dashboard/onboarding.

If the user leaves onboarding midway without completing it, then later returns and tries to sign in with a different account, they currently cannot do so because the onboarding screen has no way to sign out.

This creates a dead-end state where the partially onboarded account remains active and the user is stuck inside onboarding unless they manually clear session data or use another browser.

Steps to reproduce


  1. Sign up with a new account
  2. Get redirected to /dashboard/onboarding
  3. Leave onboarding midway without completing it
  4. Close the tab/browser
  5. Return later and open the app again
  6. Try to switch accounts or sign in with another account
  7. Observe:
    The user is automatically redirected back into onboarding for the existing session, but there is no visible sign-out action anywhere in the onboarding UI.

Expected


Users should be able to sign out during onboarding so they can:

  • switch accounts
  • restart onboarding with another user
  • recover from accidental or incomplete onboarding sessions

Where to fix


Onboarding route:

  • app/[locale]/(onboarding)/dashboard/onboarding

Relevant component:

  • marketing-header.tsx

Suggested fix


Reuse the existing marketing-header.tsx component pattern from the auth pages and add it to the onboarding flow.

Suggested header layout:

  • Brand logo / wordmark on the left
  • Sign out button on the right

Using the same flex + justify-between structure as the auth pages would keep the onboarding experience visually consistent with the rest of the authentication flow.

Hint


The auth pages already use marketing-header.tsx, so the onboarding pages can likely reuse the same component structure with minimal additional UI work.

The sign out button should use the existing auth logout flow instead of implementing separate session-clearing logic.

How to verify


  • Start onboarding with Account A
  • Leave onboarding incomplete
  • Return to the app
  • Confirm a visible Sign out button exists on /dashboard/onboarding
  • Click Sign out
  • Verify the session is cleared
  • Sign in successfully with Account B
  • Confirm onboarding works normally for the new account

Contribution guide


See CONTRIBUTING.md for branch naming, commit conventions, and PR workflow.

Activity

  1. github-actions commented on May 20, 2026

    @github-actions

    Welcome to Ansvisor, and thanks for opening your first issue!

    A maintainer will take a look soon. A few things that help us move fast:

    • Bug reports — exact steps to reproduce, what you expected vs. what happened, browser / Node version where relevant.
    • Feature requests — the use case behind the ask, so we can think about it well rather than guessing.

    If you'd like to follow Ansvisor's evolution, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land).

  2. gkhngyk commented on May 20, 2026

    @gkhngyk
    Contributor

    Design proposal: fixed bottom-right sign-out, not a full header

    Tried both directions and want to push back on the marketing-header.tsx reuse approach. A full header doesn't fit the onboarding visual model — proposing a minimal fixed bottom-right sign-out link instead.

    Why not reuse marketing-header.tsx

    A few reasons it breaks the flow:

    • Layout collision. Each onboarding step uses a centered, focused composition (max-w-md on steps 1–2, max-w-4xl on steps 3–4, max-w-lg on step 5, max-w-2xl on step 6) with its own visual hierarchy: StepDots, BrandHeader, page title, primary CTA. A sticky brand header on top duplicates the wordmark that's already in BrandHeader from step 2 onward.
    • CTA mismatch. marketing-header.tsx ships with Sign in and Create account buttons on the right. Those make zero sense on a screen where the user is already signed in. Reusing the component as-is is misleading; stripping those buttons means it's no longer "reused" anyway — it's a fork.
    • Visual priority. Sign-out is an escape hatch, not a primary action. Putting it in the top-right of a sticky header gives it more weight than the step's actual CTA. It should be discoverable but quiet.

    Proposed design

    A single small button, fixed-positioned, rendered once per step's root container.

    Position: fixed bottom-6 right-6 z-50 — viewport bottom-right, 24px gutter, always visible when scrolling long steps (step 3 / step 4 can scroll on small viewports).

    Visual style: text-only with a small leading icon — matches the existing "Back" link affordance used inside each step's footer.

    • Label: Sign out
    • Icon: LogOut from lucide-react, h-3.5 w-3.5 (same size as the ArrowLeft in the Back links)
    • Default: text-sm text-muted-foreground
    • Hover: text-foreground + subtle bg-muted to telegraph clickability
    • Padding + radius: px-2.5 py-1.5 rounded-md so the hover background sits cleanly
    • Use a native <button type="button"> for keyboard focus / a11y

    Roughly:

    function SignOutLink() {
      return (
        <button
          type="button"
          onClick={handleSignOut}
          className="fixed bottom-6 right-6 z-50 flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
        >
          <LogOut className="h-3.5 w-3.5" />
          Sign out
        </button>
      );
    }

    Drop <SignOutLink /> inside the root container of each step's return (steps 1–6). Since it's fixed, the DOM position doesn't matter visually.

    Sign-out handler

    Use the existing Supabase auth flow — same pattern as wherever the dashboard sign-out lives. After supabase.auth.signOut(), do a full-page navigation to /sign-in (not router.push) so the server-side layout reads the cleared session and middleware doesn't bounce the user back:

    const handleSignOut = async () => {
      const supabase = createClient();
      await supabase.auth.signOut();
      window.location.href = '/sign-in';
    };

    Why bottom-right specifically

    • Top-right would conflict with the StepDots / Back row that already lives at the top of step 3+ on small viewports.
    • Bottom-center competes with the primary CTA button (Continue, Looks good, etc.) which is also centered.
    • Bottom-right is the standard "escape hatch" position used by Linear, Notion, Stripe Checkout onboarding — users intuitively look here for "get me out of here" actions.

    How to verify

    • Sign up with Account A → onboarding → confirm "Sign out" visible in bottom-right on all 6 steps (5 if IS_CLOUD=false)
    • Resize viewport down to ~600px height — button stays visible at bottom-right (it's fixed, not absolute)
    • Tab key navigates to the Sign out button — focus ring visible
    • Click Sign out → lands on /sign-in, session cleared
    • Sign in with Account B → onboarding works fresh for the new account
    • Trigger dark mode — text-muted-foreground / hover:bg-muted adapt correctly
  3. sourabh-31 commented on May 20, 2026

    @sourabh-31
    ContributorAuthor

    Hi @gkhngyk, I think the proposed bottom-right sign-out approach fits the onboarding flow much better. Keeping sign-out in the top-right alongside the company branding gives it too much visual weight for something that’s meant to be a secondary “escape hatch” action rather than the primary focus of the page.

    A minimal fixed sign-out button also avoids conflicts with the existing onboarding hierarchy (BrandHeader, StepDots, titles, CTAs) and keeps the experience cleaner across all steps and smaller viewports. Since some onboarding steps can scroll on shorter screens, the fixed bottom-right placement also ensures the action stays accessible without interfering with the main CTA area.

    The suggested implementation and sign-out flow using supabase.auth.signOut() + window.location.href = '/sign-in' also makes sense to ensure the session is fully cleared server-side.

    If this direction sounds good, feel free to assign this issue to me.

  4. gkhngyk commented on May 20, 2026

    @gkhngyk
    Contributor

    Hi @gkhngyk, I think the proposed bottom-right sign-out approach fits the onboarding flow much better. Keeping sign-out in the top-right alongside the company branding gives it too much visual weight for something that’s meant to be a secondary “escape hatch” action rather than the primary focus of the page.

    A minimal fixed sign-out button also avoids conflicts with the existing onboarding hierarchy (BrandHeader, StepDots, titles, CTAs) and keeps the experience cleaner across all steps and smaller viewports. Since some onboarding steps can scroll on shorter screens, the fixed bottom-right placement also ensures the action stays accessible without interfering with the main CTA area.

    The suggested implementation and sign-out flow using supabase.auth.signOut() + window.location.href = '/sign-in' also makes sense to ensure the session is fully cleared server-side.

    If this direction sounds good, feel free to assign this issue to me.

    Thank you. Yes, I considered placing it next to the brand name at the top, but since the brand name hadn’t been created yet in onboarding step 1, it needed to be placed separately—which I found problematic from a UX perspective.

    I would appreciate it if you could implement the changes I described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions