feat: enhance admin login flow with conditional redirects based on authentication status
This commit is contained in:
@@ -18,6 +18,10 @@ export const loader = async ({ request }: Route.LoaderArgs) => {
|
||||
throw redirect('/lg-admin/login')
|
||||
}
|
||||
|
||||
if (isAuthPage && staffToken) {
|
||||
throw redirect('/lg-admin')
|
||||
}
|
||||
|
||||
if (staffToken) {
|
||||
const { data } = await getStaff({
|
||||
accessToken: staffToken,
|
||||
|
||||
Reference in New Issue
Block a user