Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AuthHttpOperator

Hierarchy

  • AuthHttpOperator

Index

Constructors

Properties

apiRootUrl: URL
baseCookieOptions: { domain?: string; path: string; sameSite: "strict" | "lax" | "none"; secure: boolean }

Type declaration

  • Optional domain?: string
  • path: string
  • sameSite: "strict" | "lax" | "none"
  • secure: boolean
dataCookieMaxAge: number
redirectRootUrl: URL
refreshDuration: number
secret: string
secure: boolean
tokenLifetime: number

Methods

  • clearCookies(res: ServerResponse): void
  • deleteAuth(res: ServerResponse): void
  • deleteError(res: ServerResponse): void
  • deleteState(res: ServerResponse): void
  • getAuth<Data>(req: IncomingMessage, platformAsserted: string, __namedParameters?: { acceptRefreshable?: boolean }): Promise<null | Data>
  • Type parameters

    • Data

    Parameters

    • req: IncomingMessage
    • platformAsserted: string
    • __namedParameters: { acceptRefreshable?: boolean } = {}
      • Optional acceptRefreshable?: boolean

    Returns Promise<null | Data>

  • getAuthUrl(platform: string, subpath?: string): string
  • getError(req: IncomingMessage, platformAsserted: string): Promise<null | ErrorMessage>
  • getRedirectUrl(path?: string): string
  • getState<State>(req: IncomingMessage, platformAsserted: string): Promise<null | State>
  • issueAuth<Data>(res: ServerResponse, platform: string, data: Data, initiateAt?: number): Promise<string>
  • issueError(res: ServerResponse, platform: string, code: number, reason: string): Promise<string>
  • issueState<State>(res: ServerResponse, platform: string, state: State): Promise<string>
  • redirect(res: ServerResponse, url?: string, __namedParameters?: { assertInternal?: boolean }): boolean
  • Parameters

    • res: ServerResponse
    • Optional url: string
    • __namedParameters: { assertInternal?: boolean } = {}
      • Optional assertInternal?: boolean

    Returns boolean

  • signToken(platform: string, payload: unknown, options?: SignOptions): string
  • verifyToken<Data>(assertedPlatform: string, token: string): null | Data

Generated using TypeDoc