Skip to content

Admin: login page and protected routes #207

Closed

Description

@Flapjacck

The frontend half of auth. Once this is done, the whole dashboard sits behind a login.

To do

  • A login page with the provider's button (or email field), with LCS branding kept simple.
  • Keep the session across refreshes (supabase.auth.onAuthStateChange), and show a loading state while it's checked.
  • Protect every dashboard route: signed out goes to /login.
  • If someone signs in but isn't an admin, show a clear "You're not an admin, ask a VP of Eng" page with a sign-out button instead of an empty dashboard.
  • A sign-out button in the dashboard header.

Done when

  • Signed out, any URL redirects to the login page
  • An admin lands on the dashboard after logging in and stays logged in after a refresh
  • A non-admin sees the "not an admin" page
  • Sign out works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    adminfrontendphase 1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions