core-components: allow guest auth without backend
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/core-components': patch
|
||||
---
|
||||
|
||||
The `SignInPage` guest provider will now fall back to legacy guest auth if the backend request fails, allowing guest auth without a running backend.
|
||||
@@ -60,7 +60,11 @@ const Component: ProviderComponent = ({
|
||||
discoveryApi,
|
||||
});
|
||||
|
||||
const identityResponse = await getIdentity(identity);
|
||||
const identityResponse = await getIdentity(identity).catch(error => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Failed to sign in as a guest, ${error}`);
|
||||
return undefined;
|
||||
});
|
||||
|
||||
if (!identityResponse) {
|
||||
// eslint-disable-next-line no-alert
|
||||
@@ -108,7 +112,11 @@ const loader: ProviderLoader = async apis => {
|
||||
provider: 'guest',
|
||||
discoveryApi: apis.get(discoveryApiRef)!,
|
||||
});
|
||||
const identityResponse = await getIdentity(identity);
|
||||
const identityResponse = await getIdentity(identity).catch(error => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Failed to sign in as a guest, ${error}`);
|
||||
return undefined;
|
||||
});
|
||||
|
||||
if (!identityResponse && !useLegacyGuestToken) {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user