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
Specific information through the login process #66
Comments
You can write your own connect route, add some state in the user's session, and then redirect to the actual connect route that Grant uses. Then inside the final callback you will have access to both the response data from the OAuth flow, and the user's state stored earlier in the session. |
Is what you call dynamic override in the documentation? |
No, it's something like this: app.get('/connect_facebook', function (req, res) {
req.session.mydata = 'hey'
res.redirect('/connect/facebook')
})
app.get('/handle_facebook_callback', function (req, res) {
console.log(req.session.mydata) // hey
// the oauth response is either in req.query or req.session.grant as usual
}) |
Well, thank you, I'll try |
Ok, it's works, great solution! |
Hi, thank you for this amazing project!
I have this requirement and I'm wondering if I can accomplish it with your library. Depending on some parameters, just after the login I have to assign a different role to the logged user.
This means that I'd want to specify "log the user with the provider and after assign him the role X".
I cannot instantiate two provider for the same type (and I don't need to), but how can I "inform" the callback that the login process has started in one way or another, that the role X has been requested?
The text was updated successfully, but these errors were encountered: