1.0.7 • Published 6 months ago
@types/passport-unique-token v1.0.7
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
- Last updated: Thu, 23 Dec 2021 23:35:16 GMT
- Dependencies: @types/passport, @types/express
- Global values: none
Credits
These definitions were written by Maxime LUCE.