feat: enhance admin login flow with conditional redirects based on authentication status

This commit is contained in:
Ardeman
2025-03-03 17:50:10 +08:00
parent 5007b8d4db
commit 1bebe61634
2 changed files with 4 additions and 13 deletions
+4
View File
@@ -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,