Skip to content

[BUG]: Account Menu displays auth-only options for logged-out / anonymous users #102

@Gautam25Raj

Description

@Gautam25Raj

Affected Apps / Packages

Studio (apps/studio)

Description

When a user is not logged in (e.g., running in local-only builder mode), the useUserStore has a user value of null. However, the sidebar's AccountMenu still renders and lists options that require an active cloud account: "Profile" (which routes to the auth-required /profile page) and "Logout" (which calls auth logout services). Additionally, there is no option in the menu or sidebar for a logged-out user to "Log In" or "Connect Account", forcing them to manually type /login in the URL bar.

  • Branch Name: fix/studio-auth-account-menu
  • PR Title: [Fix] [Studio]: hide auth-only actions in account menu for anonymous users

Steps to Reproduce

  1. Open the Studio application without logging in (or log out if logged in).
  2. Click on the account menu button at the bottom of the sidebar (labeled "Local builder").
  3. Observe that the menu dropdown displays "Profile", "Light/Dark mode", and "Logout".
  4. Notice the lack of any "Log In" or "Sign Up" button.
  5. Click "Profile" and observe it navigates to /profile but shows empty/unauthenticated fields.

Expected Behavior

If a user is logged out:

  • The AccountMenu button should show a "Connect Account" or "Sign In" option.
  • Clicking the menu should show "Sign In" (routing to /login) and the "Light/Dark mode" toggle.
  • "Profile", "Settings", and "Logout" should be hidden.

Environment Information

  • App: @veriworkly/studio
  • OS: Windows / macOS / Linux
  • Browser: Chrome / Firefox / Safari / Edge
  • Node.js: 20.x

Relevant Logs

No response

Proposed Fix / Suggestions

  • Update StudioShell.tsx to retrieve isLoggedIn from useUserStore.
  • Pass isLoggedIn to AccountMenu.
  • In AccountMenu.tsx, conditionally render the menu items:
    • If isLoggedIn is false, hide "Profile", "Settings", and "Logout", and instead display a "Sign In" item with a login icon routing to /login.
    • Change the sidebar trigger button to clearly read "Sign in to sync" or similar if collapsed is false.

Metadata

Metadata

Labels

bugSomething isn't workingfrontendUI/client-side codeui/uxDesign or user experience improvements

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions