diff --git a/.changeset/stale-stingrays-explode.md b/.changeset/stale-stingrays-explode.md new file mode 100644 index 0000000000..b8b66b8398 --- /dev/null +++ b/.changeset/stale-stingrays-explode.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-node': patch +--- + +Fixed cookie persisted scope not returned in OAuth refresh handler response. diff --git a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts index 165d7ce6b3..a0735e3ba0 100644 --- a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts +++ b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts @@ -320,7 +320,9 @@ export function createOAuthRouteHandlers( providerInfo: { idToken: result.session.idToken, accessToken: result.session.accessToken, - scope: result.session.scope, + scope: authenticator.shouldPersistScopes + ? scope + : result.session.scope, expiresInSeconds: result.session.expiresInSeconds, }, };