Skip to content

Commit

Permalink
Updating README, removing customization to sample.js
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Dec 21, 2016
1 parent dfa8a7f commit 5eda63e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ This authentication strategy relies on out-of-band information for the `secret`,
"auth": {
"jwt": {
"enabled": true,
"auth": function ( ... ) { ... }, /* Authentication handler, to 'find' or 'create' a User */
"auth": function (token, cb) { ... }, /* Authentication handler, to 'find' or 'create' a User */
"algorithms": [], /* Optional signing algorithms, defaults to ["HS256", "HS384", "HS512"] */
"audience": "", /* Optional, used to verify `aud` */
"issuer: "", /* Optional, used to verify `iss` */
Expand Down
15 changes: 4 additions & 11 deletions sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require("./index.js")({
},
auth: {
local: {
enabled: false,
enabled: true,
auth: function (username, password, callback) {
if (username === "test" && password === 123) {
callback(null, {username: username, password: password});
Expand All @@ -19,16 +19,9 @@ require("./index.js")({
}
}
},
jwt: {
enabled: true,
auth: function (username, password, callback) {
console.log(username, password, callback);
callback(null, {username: "x", password: "y"});
},
secretOrKey: "jennifer"
},
protect: ["/uuid"]
},
security: {
csrf: false
}
});

console.log('Token', jwt.sign({username: '[email protected]' }, 'jennifer'));

0 comments on commit 5eda63e

Please sign in to comment.