diff --git a/frontend/src/pages/authorize-page.tsx b/frontend/src/pages/authorize-page.tsx index ede9a24..eac8929 100644 --- a/frontend/src/pages/authorize-page.tsx +++ b/frontend/src/pages/authorize-page.tsx @@ -10,7 +10,7 @@ import { CardFooter, CardContent, } from "@/components/ui/card"; -import { getOidcClientInfoScehma } from "@/schemas/oidc-schemas"; +import { getOidcClientInfoSchema } from "@/schemas/oidc-schemas"; import { Button } from "@/components/ui/button"; import axios from "axios"; import { toast } from "sonner"; @@ -73,13 +73,13 @@ export const AuthorizePage = () => { isOidc, compiled: compiledOIDCParams, } = useOIDCParams(searchParams); - const scopes = props.scope.split(" "); + const scopes = props.scope ? props.scope.split(" ").filter(Boolean) : []; const getClientInfo = useQuery({ queryKey: ["client", props.client_id], queryFn: async () => { const res = await fetch(`/api/oidc/clients/${props.client_id}`); - const data = await getOidcClientInfoScehma.parseAsync(await res.json()); + const data = await getOidcClientInfoSchema.parseAsync(await res.json()); return data; }, enabled: isOidc, diff --git a/frontend/src/pages/login-page.tsx b/frontend/src/pages/login-page.tsx index c93b5e5..92a5656 100644 --- a/frontend/src/pages/login-page.tsx +++ b/frontend/src/pages/login-page.tsx @@ -149,6 +149,10 @@ export const LoginPage = () => { [], ); + if (isLoggedIn && isOidc) { + return ; + } + if (isLoggedIn && props.redirect_uri !== "") { return (