UNPKG

@authxyz/core

Version:

Authxyz core package for authentication implementations and providers.

27 lines (26 loc) 826 B
import type { CookieOptions, Response } from "express"; import type { SignOptions } from "jsonwebtoken"; export declare const cookieName = "_auth_kqda"; interface AuthJWTSign { data: any; options?: SignOptions; secret: string; } interface AuthCookieSign { data: any; options?: CookieOptions; } interface AuthSign { method: "JWT" | "COOKIE"; secret?: string; data: any; res: Response; options: { cookieOptions?: CookieOptions; jwtOptions?: SignOptions; }; } declare function signJwtAuth({ data, options, secret }: AuthJWTSign): string; declare function signCookieAuth(res: Response, { data, options }: AuthCookieSign): void; declare function signAuth({ method, res, data, secret, options }: AuthSign): string | void; export { signCookieAuth, signJwtAuth, signAuth };