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

1.0.7 • Public • Published

Installation

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

Summary

This package contains type definitions for passport-unique-token (https://github.com/Lughino/passport-unique-token).

Details

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

index.d.ts

import passport = require("passport");
import express = require("express");

export interface StrategyOptions {
    tokenField?: string | undefined;
    tokenQuery?: string | undefined;
    tokenParams?: string | undefined;
    tokenHeader?: string | undefined;
    failedOnMissing?: boolean | undefined;
    passReqToCallback?: false | undefined;
}

export interface StrategyOptionsWithRequest {
    tokenField?: string | undefined;
    tokenQuery?: string | undefined;
    tokenParams?: string | undefined;
    tokenHeader?: string | undefined;
    failedOnMissing?: boolean | undefined;
    passReqToCallback: true;
}

export interface VerifyOptions {
    message: string;
}

export type VerifyFunctionWithRequest = (
    req: express.Request,
    token: string,
    done: (error: any, user?: any, options?: VerifyOptions) => void,
) => void;
export type VerifyFunction = (token: string, done: (error: any, user?: any, options?: VerifyOptions) => void) => void;

export class Strategy extends passport.Strategy {
    constructor(options: StrategyOptionsWithRequest, verify: VerifyFunctionWithRequest);
    constructor(options: StrategyOptions, verify: VerifyFunction);
    constructor(verify: VerifyFunction);

    name: string;
    authenticate(req: express.Request, options?: object): void;
}

Additional Details

Credits

These definitions were written by Maxime LUCE.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/passport-unique-token

Weekly Downloads

440

Version

1.0.7

License

MIT

Unpacked Size

5.42 kB

Total Files

5

Last publish

Collaborators

  • types