From 440058affad28e8e18d515667bc87a62ae5fd3fb Mon Sep 17 00:00:00 2001 From: Pierre Donias Date: Tue, 12 Sep 2023 11:01:04 +0200 Subject: [PATCH 1/2] fix(xo-server-auth-google): bad argument passed to registerUser2 Introduced by 91b19d9bc4b782d318112972c998e87d75f586af See https://xcp-ng.org/forum/topic/7729 --- CHANGELOG.unreleased.md | 2 ++ packages/xo-server-auth-google/src/index.js | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index b4299149aa2..b7f722547a8 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -14,6 +14,7 @@ > Users must be able to say: “I had this issue, happy to know it's fixed” - [Backup/Restore] Fix `Cannot read properties of undefined (reading 'id')` error when restoring via an XO Proxy (PR [#7026](https://github.com/vatesfr/xen-orchestra/pull/7026)) +- [Google Auth] Fix `Internal Server Error` (xo-server: `Cannot read properties of undefined (reading 'id')`) when logging in with Google [Forum#7729](https://xcp-ng.org/forum/topic/7729) ### Packages to release @@ -32,6 +33,7 @@ - xo-server patch +- xo-server-auth-google patch - xo-server-netbox minor diff --git a/packages/xo-server-auth-google/src/index.js b/packages/xo-server-auth-google/src/index.js index 08ed1dd5503..a89fea2d6e2 100644 --- a/packages/xo-server-auth-google/src/index.js +++ b/packages/xo-server-auth-google/src/index.js @@ -53,8 +53,10 @@ class AuthGoogleXoPlugin { done( null, await xo.registerUser2('google', { - id: profile.id, - name: conf.scope === 'email' ? profile.emails[0].value : profile.displayName, + user: { + id: profile.id, + name: conf.scope === 'email' ? profile.emails[0].value : profile.displayName, + }, }) ) } catch (error) { From 613f0f538f912c31d217ad4dd4202ca165b3de6c Mon Sep 17 00:00:00 2001 From: Pierre Donias Date: Tue, 12 Sep 2023 11:09:13 +0200 Subject: [PATCH 2/2] PR --- CHANGELOG.unreleased.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index b7f722547a8..ca7d1a955b3 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -14,7 +14,7 @@ > Users must be able to say: “I had this issue, happy to know it's fixed” - [Backup/Restore] Fix `Cannot read properties of undefined (reading 'id')` error when restoring via an XO Proxy (PR [#7026](https://github.com/vatesfr/xen-orchestra/pull/7026)) -- [Google Auth] Fix `Internal Server Error` (xo-server: `Cannot read properties of undefined (reading 'id')`) when logging in with Google [Forum#7729](https://xcp-ng.org/forum/topic/7729) +- [Google Auth] Fix `Internal Server Error` (xo-server: `Cannot read properties of undefined (reading 'id')`) when logging in with Google [Forum#7729](https://xcp-ng.org/forum/topic/7729) (PR [#7031](https://github.com/vatesfr/xen-orchestra/pull/7031)) ### Packages to release