1 | # Installation
|
2 | > `npm install --save @types/passport-local`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for passport-local (https://github.com/jaredhanson/passport-local).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport-local.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/passport-local/index.d.ts)
|
10 | ````ts
|
11 | /// <reference types="passport"/>
|
12 |
|
13 | import { Strategy as PassportStrategy } from "passport-strategy";
|
14 | import express = require("express");
|
15 |
|
16 | interface IStrategyOptions {
|
17 | usernameField?: string | undefined;
|
18 | passwordField?: string | undefined;
|
19 | session?: boolean | undefined;
|
20 | passReqToCallback?: false | undefined;
|
21 | }
|
22 |
|
23 | interface IStrategyOptionsWithRequest {
|
24 | usernameField?: string | undefined;
|
25 | passwordField?: string | undefined;
|
26 | session?: boolean | undefined;
|
27 | passReqToCallback: true;
|
28 | }
|
29 |
|
30 | interface IVerifyOptions {
|
31 | message: string;
|
32 | }
|
33 |
|
34 | interface VerifyFunctionWithRequest {
|
35 | (
|
36 | req: express.Request,
|
37 | username: string,
|
38 | password: string,
|
39 | done: (error: any, user?: Express.User | false, options?: IVerifyOptions) => void,
|
40 | ): void;
|
41 | }
|
42 |
|
43 | interface VerifyFunction {
|
44 | (
|
45 | username: string,
|
46 | password: string,
|
47 | done: (error: any, user?: Express.User | false, options?: IVerifyOptions) => void,
|
48 | ): void;
|
49 | }
|
50 |
|
51 | declare class Strategy extends PassportStrategy {
|
52 | constructor(options: IStrategyOptionsWithRequest, verify: VerifyFunctionWithRequest);
|
53 | constructor(options: IStrategyOptions, verify: VerifyFunction);
|
54 | constructor(verify: VerifyFunction);
|
55 |
|
56 | name: string;
|
57 | }
|
58 |
|
59 | ````
|
60 |
|
61 | ### Additional Details
|
62 | * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
|
63 | * Dependencies: [@types/express](https://npmjs.com/package/@types/express), [@types/passport](https://npmjs.com/package/@types/passport), [@types/passport-strategy](https://npmjs.com/package/@types/passport-strategy)
|
64 |
|
65 | # Credits
|
66 | These definitions were written by [Maxime LUCE](https://github.com/SomaticIT).
|
67 |
|
\ | No newline at end of file |