Skip to content

Commit

Permalink
Merge pull request bnoguchi#49 from niftylettuce/master
Browse files Browse the repository at this point in the history
Added recipe bnoguchi#6
  • Loading branch information
bnoguchi committed Feb 9, 2012
2 parents 4a54ae5 + 02e8127 commit 054f570
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Expand Up @@ -493,6 +493,34 @@ mongoose.model('User', UserSchema);
User = mongoose.model('User');
```

## Recipe 6: Customizing logout handler

This is a copy of instructions from `everyauth` and applied to `mongoose-auth`:

```javascript
// ...
UserSchema.plugin(mongooseAuth, {
everymodule: {
everyauth: {
User: function () {
return User;
},
handleLogout: function(req, res) {
// Put your extra logic here
req.logout(); // The logout method is added for you by everyauth, too
// And/or put your extra logic here
res.writeHead(303, { 'Location': this.logoutRedirectPath() });
res.end();
}
}
}
// ...
});
// ...
```



### License
MIT License

Expand Down

0 comments on commit 054f570

Please sign in to comment.