From 8faf1cb76514a6565689989034faf17443e16d41 Mon Sep 17 00:00:00 2001 From: Grzegorz Grzybek Date: Mon, 13 May 2024 12:20:43 +0200 Subject: [PATCH] fix: auth/config response should never cause errors --- packages/hawtio/src/plugins/auth/oidc/oidc-service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/hawtio/src/plugins/auth/oidc/oidc-service.ts b/packages/hawtio/src/plugins/auth/oidc/oidc-service.ts index 2d6f3014..f2dff7d9 100644 --- a/packages/hawtio/src/plugins/auth/oidc/oidc-service.ts +++ b/packages/hawtio/src/plugins/auth/oidc/oidc-service.ts @@ -60,7 +60,11 @@ export class OidcService implements IOidcService { constructor() { this.config = fetchPath('auth/config', { success: (data: string) => { - return JSON.parse(data) + try { + return JSON.parse(data) + } catch { + return null + } }, error: () => null, })