auth-vir - v5.2.0
    Preparing search index...

    Function generateSuccessfulLoginHeaders

    • Used by host (backend) code to set headers on a response object. Sets both the auth JWT cookie and the CSRF token cookie. The CSRF cookie is not HttpOnly so that frontend JavaScript can read it and inject the value as a request header.

      Parameters

      • userId: string | number

        The id from your database of the user you're authenticating.

      • cookieConfig: Readonly<CookieParams>
      • OptionalsessionStartedAt: number

        The timestamp (in seconds) when the session originally started. If not provided, the current time will be used (for new sessions).

      Returns Promise<Record<string, string[]>>