From c2fde53b47f81e71d2573c03e93ce4122d4db649 Mon Sep 17 00:00:00 2001 From: Aneela Chagarlamudi Date: Tue, 2 Jan 2024 10:26:08 -0500 Subject: [PATCH] Test setCookie --- src/auth/OIDCConnector/OIDCSecured.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/auth/OIDCConnector/OIDCSecured.tsx b/src/auth/OIDCConnector/OIDCSecured.tsx index eb0227fde..657209949 100644 --- a/src/auth/OIDCConnector/OIDCSecured.tsx +++ b/src/auth/OIDCConnector/OIDCSecured.tsx @@ -20,6 +20,7 @@ import createGetUserPermissions from '../createGetUserPermissions'; import initializeAccessRequestCookies from '../initializeAccessRequestCookies'; import { getOfflineToken, prepareOfflineRedirect } from '../offline'; import { OFFLINE_REDIRECT_STORAGE_KEY } from '../../utils/consts'; +import { setCookie } from '../setCookie'; type Entitlement = { is_entitled: boolean; is_trial: boolean }; const serviceAPI = entitlementsApi(); @@ -177,6 +178,7 @@ export function OIDCSecured({ useEffect(() => { authRef.current = auth; + setCookie(authRef.current?.user?.access_token ?? '', authRef.current.user?.expires_at ?? 0); }, [auth]); if (!auth.isAuthenticated || !state.ready) {