Correct redirect from login page.
This commit is contained in:
parent
90feb0e963
commit
058577d676
@ -65,7 +65,7 @@ export const Route = createFileRoute('/login')({
|
|||||||
redirect: z.string().optional().catch('')
|
redirect: z.string().optional().catch('')
|
||||||
}),
|
}),
|
||||||
beforeLoad({ context, search }) {
|
beforeLoad({ context, search }) {
|
||||||
if (!(search.reason !== undefined || context.auth.token === null)) {
|
if (search.reason === undefined && context.auth.token !== null) {
|
||||||
throw redirect({ to: '/recipes' })
|
throw redirect({ to: '/recipes' })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user