mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:13:31 +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:
@@ -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/')
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user