upd: auth
Deskripsi: -update login - update struktur database No Issues
This commit is contained in:
@@ -27,7 +27,6 @@ export const Route = createFileRoute('/dashboard')({
|
||||
queryFn: () => fetch('/api/auth/session', { credentials: 'include' }).then((r) => r.json()),
|
||||
})
|
||||
if (!data?.user) throw redirect({ to: '/login' })
|
||||
if (data.user.role !== 'SUPER_ADMIN') throw redirect({ to: '/profile' })
|
||||
} catch (e) {
|
||||
if (e instanceof Error) throw redirect({ to: '/login' })
|
||||
throw e
|
||||
|
||||
Reference in New Issue
Block a user