auth-vir - v1.3.1
    Preparing search index...

    Function handleAuthResponse

    • Store auth data on a client (frontend) after receiving an auth response from the host (backend). Specifically, this stores the CSRF token into local storage (which doesn't need to be a secret). Alternatively, if the given response failed, this will wipe the existing (if anyone) stored CSRF token.

      Parameters

      • response: Readonly<Pick<Response, "ok" | "headers">>
      • overrides: {
            csrfHeaderName?: string;
            localStorage?: Pick<Storage, "setItem" | "removeItem">;
        } = {}
        • OptionalcsrfHeaderName?: string

          Override the default CSRF token header name.

        • OptionallocalStorage?: Pick<Storage, "setItem" | "removeItem">

          Allows mocking or overriding the global localStorage.

          globalThis.localStorage
          

      Returns void

      Error if no CSRF token header is found.