-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature of regeneration for #34 #74
Conversation
Signed-off-by: Cartoon Zhang <cartoon.zhang@zeofast.com>
Signed-off-by: Cartoon Zhang <cartoon.zhang@zeofast.com>
Just |
can't we just use |
@dead-horse 2nd, In the semantics, ctx.session={}, as well as set(), did correct logic. But what we want to do in 'regeneration', is to regenerate a new session key/code, for avoiding hack attack. |
@palmtale need to add test cases for this feature |
index.js
Outdated
@@ -105,6 +105,13 @@ function extendContext(context, opts) { | |||
return this[_CONTEXT_SESSION]; | |||
}, | |||
}, | |||
regenerateSession: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to add too many properties in ctx
, maybe we can move this method to ctx.session.regenerate()
, and it should be an async function.
@dead-horse How about this, set signal _requireRegenerate in session, and do it in commit as the same as save. |
@dead-horse Any hope of getting this merged? As it is now, we cannot use this module as we need a way to regenerate the session key when we authenticate the user. As @palmtale says, setting |
Would be great to see this merged, also due to jaredhanson/passport#907 |
Add feature of regeneration for #34