DocsNotificationsReturning to the Requested View

Returning to the Requested View

Links in notification emails open a filtered view such as /dashboard/security?cve=<id>&status=open. When you are not signed in, AsPeekIt sends you to the login page and, after the password and the two-factor code, brings you back to exactly that view.


How It Works

Opening a dashboard page without a session redirects to /login?next=<path and query>. The next parameter is set by the proxy (no session cookie), by the page guard (session lost in the browser) and when the session expires. After a successful login the browser navigates to next; with two-factor authentication enabled, next is kept while you enter the code and used once the code is accepted. Already signed-in users opening the login page are sent to next directly.

  • The query string is always kept, so the filters of the email link (CVE, status, SLA) survive the login. The hash (#...) is kept when the redirect happens in the browser (page guard, session expiry) but is lost when the link is opened without a session, because the browser never sends the hash to the server-side proxy
  • next is kept only in the login page while it is open: it is not stored in cookies or local storage
  • Without next, or when next is rejected, you land on /dashboard

Security Rules

next is validated in the browser before navigating, so it can never be used as an open redirect. The value is normalised with the standard URL parser and only same-origin paths under /dashboard are accepted (/dashboard itself or /dashboard/...). The normalised path is used, never the raw value. These values are rejected and replaced by /dashboard:

  • Absolute URLs (https://evil.example/dashboard) and protocol-relative URLs (//evil.example/dashboard)
  • javascript: and any other scheme, and relative paths without a leading slash (dashboard/security)
  • Values containing a backslash or control characters (tab, newline)
  • Paths outside the dashboard (/settings, /login) or only sharing its prefix (/dashboardevil)
  • Paths that leave the dashboard after normalisation (/dashboard/../admin, /dashboard/%2e%2e/admin)

Note: The redirect is a frontend convenience: the API still authenticates and authorizes every request, and the login endpoint returns only tokens.