From e26cb7793055dfd0d1d41f26734e11aa9ad565e9 Mon Sep 17 00:00:00 2001 From: Jan Ullrich Date: Fri, 20 May 2022 18:45:20 +0200 Subject: [PATCH] fix(ui): Fix reading token from session storage --- services/ui/src/auth/getUser.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/services/ui/src/auth/getUser.ts b/services/ui/src/auth/getUser.ts index 5667bcc1..fcb5ff79 100644 --- a/services/ui/src/auth/getUser.ts +++ b/services/ui/src/auth/getUser.ts @@ -1,9 +1,8 @@ import { User } from "oidc-client-ts"; +import { oidc } from "./config/oidc"; export function getUser() { - const oidcStorage = sessionStorage.getItem( - "oidc.user:http://localhost:8080/auth/realms/habitcentric:ui" - ); + const oidcStorage = sessionStorage.getItem(`oidc.user:${oidc.authority}:ui`); if (!oidcStorage) { return null; }