1.0.4 • Published 6 months ago

@types/passport-auth-token v1.0.4

Weekly downloads
83
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for passport-auth-token 1.0
// Project: https://github.com/mbell8903/passport-auth-token.git
// Definitions by: Ian Woongsoo Lee <https://github.com/yummyummyummy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <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.

1.0.2

8 months ago

1.0.4

6 months ago

1.0.3

7 months ago

1.0.1

3 years ago

1.0.0

3 years ago