sanpassport
About
Passport passport-local and passport-google-oauth wrapper.
Settings
Install sanpassport
$ npm install sanpassport
An example:
//see http://passportjs.org/docs/configurelet sanpassport = { // optional // ... } { //optional // ... } local: { //... } options: //optional usernameField: 'email' passwordField: 'password' { // ... ; } google: { //... } options: clientID: "your_client_id" clientSecret: "SHHHH! It's a secret" failureRedirect : "/" jwt: { } options: // see https://www.npmjs.com/package/passport-jwt#usage ;
Use
An example with express.js:
app;app;//optional// googleapp; app; // localapp;app;app; // jwtapp;app;
See test/basic.js
for more details.
To Do
- Strategies
- Local
- Google OAuth2.0
- JSON Web Token
- OAuth
- New Strategy
Changelog
5.0.0
- New formmat
- JWT strategy
4.0.1 (26-05-2017)
4.0.0 (17-01-2017)
- Node v6 or newer only.
- Google Oauth supported.
3.0.0 (27-10-2016)
- Travis integration.
- Logout removed as param.
- Strategy Local options added as params.
2.2.0 (26-10-2016)
- Logout function added as param.
2.1.0 (7-10-2016)
- ensureAuthenticated functions added as param.
2.0.2 (8-9-2016)
- Password validation.
2.0.1 (7-9-2016)
- Strategy Function added as param.
- Passport dependencie and removed as param.
- Serialize user with id or _id.
- Model create method beside new instance.
- Test module
1.4.0 (25-7-2016)
- README with examples.
1.0.0 (12-06-2016)
Start