Skip to content

Commit bbb954c

Browse files
author
Rowan Wookey
committed
Merge remote-tracking branch '102/patch-1' jaredhanson#162
2 parents 38d2bed + 64c5eb1 commit bbb954c

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

README.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,17 @@ By default, `LocalStrategy` expects to find credentials in parameters
6060
named username and password. If your site prefers to name these fields
6161
differently, 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

7375
When session support is not necessary, it can be safely disabled by
7476
setting the `session` option to false.
@@ -77,17 +79,19 @@ The verify callback can be supplied with the `request` object by setting
7779
the `passReqToCallback` option to true, and changing callback arguments
7880
accordingly.
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

Comments
 (0)