mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
We might not get email data from some users if they didn't allow access to the address. Quick fix for now, should show an error page instead.
This commit is contained in:
parent
9447d72468
commit
370248d919
1 changed files with 14 additions and 9 deletions
|
@ -31,15 +31,20 @@ module.exports = function(options) {
|
|||
app.get(
|
||||
'/auth/oauth/callback'
|
||||
, function(req, res) {
|
||||
res.redirect(urlutil.addParams(options.appUrl, {
|
||||
jwt: jwtutil.encode({
|
||||
payload: {
|
||||
email: req.user.email
|
||||
, name: req.user.email.split('@', 1).join('')
|
||||
}
|
||||
, secret: options.secret
|
||||
})
|
||||
}))
|
||||
if (req.user.email) {
|
||||
res.redirect(urlutil.addParams(options.appUrl, {
|
||||
jwt: jwtutil.encode({
|
||||
payload: {
|
||||
email: req.user.email
|
||||
, name: req.user.email.split('@', 1).join('')
|
||||
}
|
||||
, secret: options.secret
|
||||
})
|
||||
}))
|
||||
}
|
||||
else {
|
||||
res.redirect('/auth/oauth/')
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue