UNPKG

@pedwise/next-firebase-auth-edge

Version:

Next.js 13 Firebase Authentication for Edge and server runtimes. Dedicated for Next 13 server components. Compatible with Next.js middleware.

34 lines (33 loc) 1.03 kB
import { ServiceAccountCredential } from "../credential"; import { ErrorInfo } from "../error"; export interface CryptoSigner { readonly algorithm: "RS256" | "none"; sign(token: string): Promise<string>; getAccountId(): Promise<string>; } export declare class ServiceAccountSigner implements CryptoSigner { private readonly credential; algorithm: "RS256"; constructor(credential: ServiceAccountCredential); sign(token: string): Promise<string>; /** * @inheritDoc */ getAccountId(): Promise<string>; } export interface ExtendedErrorInfo extends ErrorInfo { cause?: Error; } export declare class CryptoSignerError extends Error { private errorInfo; constructor(errorInfo: ExtendedErrorInfo); get code(): string; get message(): string; get cause(): Error | undefined; } export declare class CryptoSignerErrorCode { static INVALID_ARGUMENT: string; static INTERNAL_ERROR: string; static INVALID_CREDENTIAL: string; static SERVER_ERROR: string; }