@@ -60,15 +60,17 @@ By default, `LocalStrategy` expects to find credentials in parameters
6060named username and password. If your site prefers to name these fields
6161differently, options are available to change the defaults.
6262
63- passport.use(new LocalStrategy({
64- usernameField: 'email',
65- passwordField: 'passwd',
66- session: false
67- },
68- function(username, password, done) {
69- // ...
70- }
71- ));
63+ ``` js
64+ passport .use (new LocalStrategy ({
65+ usernameField: ' email' ,
66+ passwordField: ' passwd' ,
67+ session: false
68+ },
69+ function (username , password , done ) {
70+ // ...
71+ }
72+ ));
73+ ```
7274
7375When session support is not necessary, it can be safely disabled by
7476setting the ` session ` option to false.
@@ -77,17 +79,19 @@ The verify callback can be supplied with the `request` object by setting
7779the ` passReqToCallback ` option to true, and changing callback arguments
7880accordingly.
7981
80- passport.use(new LocalStrategy({
81- usernameField: 'email',
82- passwordField: 'passwd',
83- passReqToCallback: true,
84- session: false
85- },
86- function(req, username, password, done) {
87- // request object is now first argument
88- // ...
89- }
90- ));
82+ ``` js
83+ passport .use (new LocalStrategy ({
84+ usernameField: ' email' ,
85+ passwordField: ' passwd' ,
86+ passReqToCallback: true ,
87+ session: false
88+ },
89+ function (req , username , password , done ) {
90+ // request object is now first argument
91+ // ...
92+ }
93+ ));
94+ ```
9195
9296#### Authenticate Requests
9397
0 commit comments