Skip to content

Login button should redirect authenticated users to dashboard instead of login page #234

@2u841r

Description

@2u841r

Even if I’m already logged in at https://cloud.umami.is/, everything works fine when I visit that URL directly.

However, if I click the Log in button in the navbar (which links to https://cloud.umami.is/login?ref=umami-nav-header

<Link href={`https://cloud.umami.is/login${query}`} data-umami-event="login-button-header">

I’m asked to re-enter my credentials — even though I’m already logged in.

If I manually remove the /login part from the URL and press enter, I’m redirected to the dashboard — meaning the session is still active.

Proposal:

  1. Add a login check
    If the user is already logged in, automatically redirect them to https://cloud.umami.is/analytics.

    Note: Direct visiting the /analytics route currently returns 404, and /analytics/eu causes a too many redirects error — two additional bugs that need attention.

  2. Simplify the login button
    Update the button link to conditionally direct users:

    <Link
      href={`https://cloud.umami.is/${query}`}
      data-umami-event="login-button-header"
    >

    This should correctly route users either to /login (if not logged in) or to /analytics/[us|eu]/websites/ (if authenticated).

Metadata

Metadata

Assignees

No one assigned

    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