Skip to content

Commit 5f36cdd

Browse files
authored
Updated -- authentication.md Clarify passport-local default behavior
1 parent 3952e92 commit 5f36cdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/techniques/authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export class LocalStrategy extends PassportStrategy(Strategy) {
260260
}
261261
```
262262

263-
We've followed the recipe described earlier for all Passport strategies. In our use case with passport-local, there are no configuration options, so our constructor simply calls `super()`, without an options object.
263+
We've followed the recipe described earlier for all Passport strategies. In our use case with passport-local, there are no configuration options, so our constructor simply calls `super()`, without an options object. Notice passport-local strategy looking for **username** and **password** field in the request body by default, you can change the default behaviour using options object: `super({ usernameField: 'email' })`.
264264

265265
We've also implemented the `validate()` method. For each strategy, Passport will call the verify function (implemented with the `validate()` method in `@nestjs/passport`) using an appropriate strategy-specific set of parameters. For the local-strategy, Passport expects a `validate()` method with the following signature: `validate(username: string, password:string): any`.
266266

0 commit comments

Comments
 (0)