Now loading user in a wrapper for the app, added loading screen

This commit is contained in:
Carter 2024-10-29 11:13:51 -06:00
parent 864b7b0689
commit eafb88ebfc
8 changed files with 734 additions and 66 deletions

View file

@ -19,21 +19,13 @@ export default function AuthWrapper(props: Props) {
if (isAuthenticated) getAccessTokenSilently().then(t => {
if (t.length < 1) {
loginWithRedirect()
} else {
}
setToken(t)
}).catch(() => {
// No token, go back to login
loginWithRedirect()
})
}, [setToken, isAuthenticated])
}, [setToken, isAuthenticated])
if (isAuthenticated) return (
children
)
return (
<p>Redirecting...</p>
)
return children;
}