@types/passport-google-oauth2
TypeScript icon, indicating that this package has built-in type declarations

0.1.8 • Public • Published

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

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, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/express

Credits

These definitions were written by Elliot Blackburn, and Mike Francis.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/passport-google-oauth2

Weekly Downloads

29,490

Version

0.1.8

License

MIT

Unpacked Size

6.17 kB

Total Files

5

Last publish

Collaborators

  • types