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
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: @types/express, @types/passport
Credits
These definitions were written by Maxime LUCE.