auth-vir - v3.1.0
    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">>
      • options: Readonly<
            _RequireExactlyOne<
                { csrfHeaderName: string; csrfHeaderPrefix: string },
                "csrfHeaderPrefix" | "csrfHeaderName",
            >,
        > & PartialWithUndefined<
            { localStorage: Pick<Storage, "setItem" | "removeItem"> },
        >

      Returns void

      Error if no CSRF token header is found.