jbuck / express-persona

Mozilla Persona integration for Express
http://jbuck.github.com/express-persona
BSD 2-Clause "Simplified" License
66 stars 16 forks source link

easy custom responses #3

Closed dgreisen closed 12 years ago

dgreisen commented 12 years ago

verifyResponse is now called to generate the response to the verify route. Default response is identical to old response. It can now be overridden in the options.

logoutResponse is now called to generate the response to the logout route. Default response is identical to old response. It can now be overridden in the options.

this is useful for people who want to send custom information with their login response (such as user object from database), or for people who already have a front-end that expects a specific format from the server.

jbuck commented 12 years ago

This looks great! I'll add some nitpicks in the comments, but nothing major.

Would you like to take a crack at adding tests for these two parameters too?

dgreisen commented 12 years ago

Fixed the typos and added test

jbuck commented 12 years ago

Bah, of course http://personatestuser.org is down when I need it... I'm going to wait until it's back up before merging this.

jbuck commented 12 years ago

Alright, merged and published to npm. Thanks again for doing this!

dgreisen commented 12 years ago

sure. Nice byproduct of custom response function that I just noticed is that you can now pass arbitrary data to the back end for tracking and whatnot in addition to the assertion. might consider mentioning that in the docs.

On Wed, Oct 3, 2012 at 5:18 PM, Jon Buckley notifications@github.comwrote:

Alright, merged and published to npm. Thanks again for doing this!

— Reply to this email directly or view it on GitHubhttps://github.com/jbuck/express-persona/pull/3#issuecomment-9122637.