Skip to content

Commit

Permalink
Actually use new email and return immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
nebulade committed Jun 5, 2024
1 parent dad1401 commit b1ca589
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,5 @@
[1.11.1]
* Update user email if changed at the OpenID provider

[1.11.2]
* Update user email if changed at the OpenID provider
4 changes: 2 additions & 2 deletions CloudronManifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"releases",
"github"
],
"version": "1.11.1",
"upstreamVersion": "1.11.1",
"version": "1.11.2",
"upstreamVersion": "1.11.2",
"healthCheckPath": "/api/v1/status",
"httpPort": 3000,
"manifestVersion": 2,
Expand Down
3 changes: 2 additions & 1 deletion backend/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ async function auth(req, res, next) {
// update email if changed
if (user.email !== req.oidc.user.email) {
try {
await database.users.update(user.id, user.githubToken, user.email);
await database.users.update(user.id, user.githubToken, req.oidc.user.email);
user.email = req.oidc.user.email;
} catch (e) {
console.error('Failed to update email for user.', user, e);
}
Expand Down

0 comments on commit b1ca589

Please sign in to comment.