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

1.0.4 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/passport-auth-token

Weekly Downloads

1,773

Version

1.0.4

License

MIT

Unpacked Size

5.67 kB

Total Files

5

Last publish

Collaborators

  • types