0.1.8 • Published 6 months ago
@types/passport-google-oauth2 v0.1.8
Installation
npm install --save @types/passport-google-oauth2
Summary
This package contains type definitions for passport-google-oauth2 (https://github.com/mstade/passport-google-oauth2).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport-google-oauth2.
index.d.ts
// Type definitions for passport-google-oauth2 0.1
// Project: https://github.com/mstade/passport-google-oauth2
// Definitions by: Elliot Blackburn <https://github.com/bluehatbrit>
// Mike Francis <https://github.com/mikefrancis>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { Request } from 'express';
export interface StrategyOptions {
clientID: string;
clientSecret: string;
callbackURL: string;
passReqToCallback?: true | undefined;
scope?: string[] | string | undefined;
proxy?: boolean | undefined;
}
export interface StrategyOptionsWithRequest {
clientID: string;
clientSecret: string;
callbackURL: string;
passReqToCallback: true;
scope?: string[] | string | undefined;
}
export interface VerifyOptions {
message: string;
}
export type VerifyCallback = (error: any, user?: any, options?: VerifyOptions) => void;
export type VerifyFunctionWithRequestAndParams = (
req: Request,
accessToken: string,
refreshToken: string,
params: {
access_token: string;
expires_in: number;
scope: string;
token_type: 'Bearer';
id_token: string;
},
profile: any,
done: VerifyCallback,
) => void;
export type VerifyFunctionWithRequest = (
req: Request,
accessToken: string,
refreshToken: string,
profile: any,
done: VerifyCallback
) => void;
export type VerifyFunction = (accessToken: string, refreshToken: string, profile: any, done: VerifyCallback) => void;
export class Strategy implements Strategy {
name: string;
authenticate: (req: Request, options?: object) => void;
constructor(options: StrategyOptionsWithRequest, verify: VerifyFunctionWithRequest | VerifyFunctionWithRequestAndParams);
constructor(options: StrategyOptions, verify: VerifyFunction);
constructor(verify: VerifyFunction);
}
Additional Details
- Last updated: Tue, 29 Mar 2022 18:01:51 GMT
- Dependencies: @types/express
- Global values: none
Credits
These definitions were written by Elliot Blackburn, and Mike Francis.