You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It took me some time to grasp the concepts behind the authorize flow, and overriding the authenticate handler. There are numerous threads about this in the node-oauth2-server project, as I'm sure you are aware. I think even if your example included this commented out, this might be helpful?
Something like this?
oauth.authorize(request, response, {
authenticateHandler: {
handle: function(req, res) {
if (req.body.userId) {
// return full user object if necessary, otherwise just the ID
return req.body.userId;
}
else {
// redirect to login form
}
}
}
})
.then(function(success) {
console.log("SUCCESS", success);
cb(false, success);
})
.catch(function(err) {
console.log("AUTH ERR", err);
cb(err);
})
The text was updated successfully, but these errors were encountered:
Hello,
It took me some time to grasp the concepts behind the authorize flow, and overriding the authenticate handler. There are numerous threads about this in the node-oauth2-server project, as I'm sure you are aware. I think even if your example included this commented out, this might be helpful?
Something like this?
The text was updated successfully, but these errors were encountered: