-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.d.ts
36 lines (32 loc) · 1.63 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { RequestHandler, Request, Response, NextFunction } from 'express';
export function expressGAuth(options: GauthOptions): RequestHandler;
export interface GauthOptions {
readonly clientID: string;
readonly clientSecret: string;
readonly clientDomain: string;
readonly allowedDomains?: ReadonlyArray<string>;
readonly allowedEmails?: ReadonlyArray<string>;
readonly publicEndPoints?: ReadonlyArray<string>;
readonly ignoreUrlParamsOfPublicEndPoints?: boolean;
readonly logger?: { log: (...output: any[]) => void, error: (...output: any[]) => void };
readonly unauthorizedUser?: (req: Request, res: Response, next: NextFunction, user: unknown) => void;
readonly errorPassportAuth?: (req: Request, res: Response, next: NextFunction, err) => void;
readonly errorNoUser?: (req: Request, res: Response, next: NextFunction) => void;
readonly errorLogin?: (req: Request, res: Response, next: NextFunction, err: unknown) => void;
readonly serializeUser?: (user: unknown, done: DoneCallback<unknown>) => void;
readonly deserializeUser?: (user: unknown, done: DoneCallback<unknown>) => void;
readonly returnToOriginalUrl?: boolean;
readonly isReturnUrlAllowed?: (url: string) => boolean;
readonly googleAuthorizationParams?: {
readonly scope?: ReadonlyArray<string>;
readonly prompt?: 'none' | 'consent' | 'select_account';
readonly accessType?: 'offline' | 'online';
readonly hostedDomain?: string;
readonly loginHint?: string;
readonly includeGrantedScopes?: boolean;
},
readonly refreshBefore?: number;
}
export type DoneCallback<T> =
& ((err: unknown) => void)
& ((err: null, value: T) => void);