npm.io
1.0.4 • Published 2 years ago

@types/passport-auth-token

Licence
MIT
Version
1.0.4
Deps
3
Size
6 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/passport-auth-token

Summary

This package contains type definitions for passport-auth-token (https://github.com/mbell8903/passport-auth-token.git).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport-auth-token.

index.d.ts

/// <reference types="passport"/>

import express = require("express");
import { Strategy as PassportStrategy } from "passport-strategy";

interface StrategyOptions {
    tokenFields?: string[] | undefined;
    headerFields?: string[] | undefined;
    session?: boolean | undefined;
    passReqToCallback?: false | undefined;
    params?: boolean | undefined;
    optional?: boolean | undefined;
    caseInsensitive?: boolean | undefined;
}

interface StrategyOptionsWithRequest {
    tokenFields?: string[] | undefined;
    headerFields?: string[] | undefined;
    session?: boolean | undefined;
    passReqToCallback: true;
    params?: boolean | undefined;
    optional?: boolean | undefined;
    caseInsensitive?: boolean | undefined;
}

interface VerifyOptions {
    message: string;
}

interface VerifyFunctionWithRequest {
    (req: express.Request, token: string, done: (error: any, user?: any, options?: VerifyOptions) => void): void;
}

interface VerifyFunction {
    (token: string, done: (error: any, user?: any, options?: VerifyOptions) => void): void;
}

declare class Strategy extends PassportStrategy {
    constructor(options: StrategyOptionsWithRequest, verify: VerifyFunctionWithRequest);
    constructor(options: StrategyOptions, verify: VerifyFunction);
    constructor(verify: VerifyFunction);

    name: string;
}

export = Strategy;

Additional Details

Credits

These definitions were written by Ian Woongsoo Lee.