|
@@ -20,10 +20,6 @@ export const Route = createFileRoute('/_authenticated')({
|
|
|
|
|
|
|
|
const authState = useAuthStore.getState()
|
|
const authState = useAuthStore.getState()
|
|
|
|
|
|
|
|
- const persisted = localStorage.getItem('auth-storage')
|
|
|
|
|
-
|
|
|
|
|
- const hasPersistedToken = persisted && JSON.parse(persisted)?.state?.token
|
|
|
|
|
-
|
|
|
|
|
const {
|
|
const {
|
|
|
token,
|
|
token,
|
|
|
isAuthenticated,
|
|
isAuthenticated,
|
|
@@ -33,7 +29,7 @@ export const Route = createFileRoute('/_authenticated')({
|
|
|
setProfileFetched,
|
|
setProfileFetched,
|
|
|
} = authState
|
|
} = authState
|
|
|
|
|
|
|
|
- if (!token || !isAuthenticated || !hasPersistedToken) {
|
|
|
|
|
|
|
+ if (!token || !isAuthenticated) {
|
|
|
logout()
|
|
logout()
|
|
|
|
|
|
|
|
throw redirect({
|
|
throw redirect({
|