1.0.7 • Published 6 months ago

@types/passport-unique-token v1.0.7

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

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

// Type definitions for passport-unique-token 1.0
// Project: https://github.com/Lughino/passport-unique-token
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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.

1.0.7

6 months ago

1.0.6

7 months ago

1.0.5

8 months ago

1.0.4

2 years ago

1.0.3

3 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago