Skip to content

Commit

Permalink
Test setCookie
Browse files Browse the repository at this point in the history
  • Loading branch information
aneelac22 committed Jan 2, 2024
1 parent e9432bd commit c2fde53
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/auth/OIDCConnector/OIDCSecured.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c2fde53

Please sign in to comment.