From 89d13e56183b36cc45fda7ff492b93f8bf841dd0 Mon Sep 17 00:00:00 2001 From: Tomasz Szuba Date: Wed, 18 Oct 2023 14:06:23 +0200 Subject: [PATCH] Add current and defaultScopes when refreshing session Otherwise google auth always fails, as it lacks userinfo.profile Signed-off-by: Tomasz Szuba --- .changeset/red-yaks-press.md | 5 +++++ .../lib/AuthSessionManager/RefreshingAuthSessionManager.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/red-yaks-press.md diff --git a/.changeset/red-yaks-press.md b/.changeset/red-yaks-press.md new file mode 100644 index 0000000000..7166ac345e --- /dev/null +++ b/.changeset/red-yaks-press.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-app-api': patch +--- + +Add current and default scopes when refreshing session diff --git a/packages/core-app-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts b/packages/core-app-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts index c04eb637de..c92fe9fb20 100644 --- a/packages/core-app-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts +++ b/packages/core-app-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts @@ -137,7 +137,9 @@ export class RefreshingAuthSessionManager implements SessionManager { return this.refreshPromise; } - this.refreshPromise = this.connector.refreshSession(scopes); + this.refreshPromise = this.connector.refreshSession( + this.helper.getExtendedScope(this.currentSession, scopes), + ); try { const session = await this.refreshPromise;