UNPKG

@paroicms/server

Version:
19 lines (18 loc) 854 B
import type { PaHttpContext } from "@paroicms/public-server-lib"; import type { Request, Response } from "express"; import type { InteractiveLoginMethod } from "./auth.types.js"; export interface BearerTokenPayload { id: string; email: string; fqdn: string; loginMethod: InteractiveLoginMethod; } export declare function authGuard(httpContext: PaHttpContext): BearerTokenPayload; export interface GoogleUser { email: string; } export declare function googleAuthGuard(req: Request, res: Response): Promise<GoogleUser>; export declare function verifyAccessToken(token: string): BearerTokenPayload; export declare function verifyPlatformToken(platformToken: string): GoogleUser; export declare function generateAccessToken(payload: BearerTokenPayload): string; export declare function generatePlatformToken(payload: GoogleUser): string;