UNPKG

next-bungie-auth

Version:

Next Bungie Auth is an open source Next.js library that provides a configurable solution for authenticating your users with Bungie.net

31 lines (30 loc) 1.71 kB
import type { BungieTokenResponse, NextBungieAuthConfig } from "../types"; import type { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies"; /** @internal */ export declare const setStateCookie: (state: string, cookieJar: ReadonlyRequestCookies, config: NextBungieAuthConfig) => void; /** @internal */ export declare const getStateCookie: (cookieJar: ReadonlyRequestCookies, config: NextBungieAuthConfig) => string | undefined; /** @internal */ export declare const clearStateCookie: (cookieJar: ReadonlyRequestCookies, config: NextBungieAuthConfig) => void; /** @internal */ export declare const setCallbackCookie: (callbackUrl: string, cookieJar: ReadonlyRequestCookies, config: NextBungieAuthConfig) => void; /** @internal */ export declare const getCallbackCookie: (cookieJar: ReadonlyRequestCookies, config: NextBungieAuthConfig) => string | undefined; /** @internal */ export declare const clearCallbackCookie: (cookieJar: ReadonlyRequestCookies, config: NextBungieAuthConfig) => void; /** @internal */ export declare const getAllCookies: (cookieJar: ReadonlyRequestCookies, config: NextBungieAuthConfig) => { accessExpires: Date; bungieMembershipId: string | undefined; accessToken: string | null; refreshToken: string | null; }; /** @internal */ export declare const setAllCookies: ({ tokens, sessionAge, accessAge, accessExpires, }: { tokens: BungieTokenResponse; sessionAge: number; accessAge: number; accessExpires: Date; }, cookieJar: ReadonlyRequestCookies, config: NextBungieAuthConfig) => void; /** @internal */ export declare const clearAllCookies: (cookieJar: ReadonlyRequestCookies, config: NextBungieAuthConfig) => void;