From 2433175a9c00b82a3a56953386a2126d6e3f2b1b Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Tue, 19 Nov 2024 08:54:04 +0100 Subject: [PATCH] wait for login to finish (#35044) fixes: #34864 Signed-off-by: Erik Jan de Wit (cherry picked from commit ced8e643c9c80ccd549439d0db9d03088748b464) --- js/apps/admin-ui/src/admin-client.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/apps/admin-ui/src/admin-client.ts b/js/apps/admin-ui/src/admin-client.ts index 620675ee23b9..df8a116336cf 100644 --- a/js/apps/admin-ui/src/admin-client.ts +++ b/js/apps/admin-ui/src/admin-client.ts @@ -4,7 +4,6 @@ import { useRequiredContext, } from "@keycloak/keycloak-ui-shared"; import type Keycloak from "keycloak-js"; - import type { Environment } from "./environment"; export type AdminClientProps = { @@ -31,7 +30,7 @@ export async function initAdminClient( try { await keycloak.updateToken(5); } catch { - keycloak.login(); + await keycloak.login(); } return keycloak.token;