From 7107700834711b98f9664d9f66009a2ce0e3cdf5 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Dec 2025 00:56:32 +0000 Subject: [PATCH] Display OIDC access denied errors on login page Extract error messages from URL query parameters and display them in the existing error box on the login page, then clean up the URL. This fixes the UX issue where OIDC access denied errors were only visible in the URL bar as query parameters. --- src/app/login/page.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 94877e1..0341fe3 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -208,6 +208,18 @@ function LoginContent() { } }, [searchParams, user, authLoading, setAuthData, router]); + // Handle error messages from URL query parameters (e.g., OIDC access denied) + useEffect(() => { + const errorParam = searchParams.get('error'); + if (errorParam) { + setError(decodeURIComponent(errorParam)); + // Clean up URL by removing the error parameter + const newUrl = new URL(window.location.href); + newUrl.searchParams.delete('error'); + window.history.replaceState({}, '', newUrl.toString()); + } + }, [searchParams]); + const handlePlexLogin = async () => { setIsLoggingIn(true); setError(null);