diff --git a/src/Login.tsx b/src/Login.tsx index 6264243e..2d96765b 100644 --- a/src/Login.tsx +++ b/src/Login.tsx @@ -18,13 +18,13 @@ import { } from '@chakra-ui/react'; import { useActor } from '@xstate/react'; import React from 'react'; -import { useAuth } from './authContext'; +import { useAuth, useLoggedInUserData } from './authContext'; import { registryLinks } from './registryLinks'; export const Login: React.FC> = (props) => { const authService = useAuth(); + const loggedInUserData = useLoggedInUserData(); const [state] = useActor(authService); - const session = state.context!.client.auth.session(); return ( @@ -44,28 +44,23 @@ export const Login: React.FC> = (props) => { )} - {state.hasTag('authorized') && ( + {state.hasTag('authorized') && loggedInUserData && ( - {state.context.loggedInUserData && ( + {loggedInUserData && ( View Machines