fix: login page not working
This commit is contained in:
8 files changed
+76
-143
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_api/login")({
|
||||
beforeLoad: async ({ context, location }) => {
|
||||
if (location.pathname === "/login") {
|
||||
const api = context.api;
|
||||
console.log(api);
|
||||
const publicUsers = (await getUserApi(api).getPublicUsers()).data;
|
||||
if (publicUsers.length > 0) {
|
||||
throw redirect({ to: "/login/list" });
|
||||
}
|
||||
throw redirect({ to: "/login/manual" });
|
||||
}
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user