Merge pull request #23574 from backstage/auth/fix-user-missing

fix: Guest Provider sign-in without a user in the Catalog
This commit is contained in:
Patrik Oldsberg
2024-03-15 13:03:12 +01:00
committed by GitHub
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend-module-guest-provider': patch
---
Fix issue for issuing a token when `guest` user does not exist in catalog
@@ -46,7 +46,7 @@ export const signInAsGuestUser: (config: Config) => SignInResolver<{}> =
'ownershipEntityRefs',
) ?? [userRef];
try {
return ctx.signInWithCatalogUser({ entityRef: userRef });
return await ctx.signInWithCatalogUser({ entityRef: userRef });
} catch (err) {
// We can't guarantee that a guest user exists in the catalog, so we issue a token directly,
return ctx.issueToken({