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 | // Type definitions for passport-local 1.0.0
|
12 | // Project: https://github.com/jaredhanson/passport-local
|
13 | // Definitions by: Maxime LUCE <https://github.com/SomaticIT>
|
14 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
15 | // TypeScript Version: 2.3
|
16 |
|
17 | /// <reference types="passport"/>
|
18 |
|
19 | import { Strategy as PassportStrategy } from "passport-strategy";
|
20 | import express = require("express");
|
21 |
|
22 | interface IStrategyOptions {
|
23 | usernameField?: string | undefined;
|
24 | passwordField?: string | undefined;
|
25 | session?: boolean | undefined;
|
26 | passReqToCallback?: false | undefined;
|
27 | }
|
28 |
|
29 | interface IStrategyOptionsWithRequest {
|
30 | usernameField?: string | undefined;
|
31 | passwordField?: string | undefined;
|
32 | session?: boolean | undefined;
|
33 | passReqToCallback: true;
|
34 | }
|
35 |
|
36 | interface IVerifyOptions {
|
37 | message: string;
|
38 | }
|
39 |
|
40 | interface VerifyFunctionWithRequest {
|
41 | (
|
42 | req: express.Request,
|
43 | username: string,
|
44 | password: string,
|
45 | done: (error: any, user?: any, options?: IVerifyOptions) => void
|
46 | ): void;
|
47 | }
|
48 |
|
49 | interface VerifyFunction {
|
50 | (
|
51 | username: string,
|
52 | password: string,
|
53 | done: (error: any, user?: any, options?: IVerifyOptions) => void
|
54 | ): void;
|
55 | }
|
56 |
|
57 | declare class Strategy extends PassportStrategy {
|
58 | constructor(
|
59 | options: IStrategyOptionsWithRequest,
|
60 | verify: VerifyFunctionWithRequest
|
61 | );
|
62 | constructor(options: IStrategyOptions, verify: VerifyFunction);
|
63 | constructor(verify: VerifyFunction);
|
64 |
|
65 | name: string;
|
66 | }
|
67 |
|
68 | ````
|
69 |
|
70 | ### Additional Details
|
71 | * Last updated: Wed, 07 Jul 2021 17:02:26 GMT
|
72 | * Dependencies: [@types/passport-strategy](https://npmjs.com/package/@types/passport-strategy), [@types/express](https://npmjs.com/package/@types/express), [@types/passport](https://npmjs.com/package/@types/passport)
|
73 | * Global values: none
|
74 |
|
75 | # Credits
|
76 | These definitions were written by [Maxime LUCE](https://github.com/SomaticIT).
|
77 |
|
\ | No newline at end of file |