From 1dc51542aaec7d7c3885cf86c00f0c8610b2f95f Mon Sep 17 00:00:00 2001 From: fallenbagel <98979876+fallenbagel@users.noreply.github.com> Date: Wed, 4 Mar 2026 03:22:01 +0500 Subject: [PATCH] fix(setup): fix Plex login not proceeding after authentication (#2596) --- src/components/Setup/LoginWithPlex.tsx | 13 ++++++++----- src/components/Setup/SetupLogin.tsx | 15 ++++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/components/Setup/LoginWithPlex.tsx b/src/components/Setup/LoginWithPlex.tsx index e7a078dd..2198891d 100644 --- a/src/components/Setup/LoginWithPlex.tsx +++ b/src/components/Setup/LoginWithPlex.tsx @@ -25,11 +25,14 @@ const LoginWithPlex = ({ onComplete }: LoginWithPlexProps) => { useEffect(() => { const login = async () => { - const response = await axios.post('/api/v1/auth/plex', { authToken }); - - if (response.data?.id) { - const { data: user } = await axios.get('/api/v1/auth/me'); - revalidate(user, false); + try { + const response = await axios.post('/api/v1/auth/plex', { authToken }); + if (response.data?.id) { + const { data: user } = await axios.get('/api/v1/auth/me'); + revalidate(user, false); + } + } catch { + // auth failed silently, user can retry again } }; if (authToken) { diff --git a/src/components/Setup/SetupLogin.tsx b/src/components/Setup/SetupLogin.tsx index c9539d1f..9a1d1236 100644 --- a/src/components/Setup/SetupLogin.tsx +++ b/src/components/Setup/SetupLogin.tsx @@ -41,12 +41,17 @@ const SetupLogin: React.FC = ({ useEffect(() => { const login = async () => { - const response = await axios.post('/api/v1/auth/plex', { - authToken: authToken, - }); + try { + const response = await axios.post('/api/v1/auth/plex', { + authToken: authToken, + }); - if (response.data?.email) { - revalidate(); + if (response.data?.id) { + const { data: user } = await axios.get('/api/v1/auth/me'); + revalidate(user, false); + } + } catch { + // auth failed silently and user can attempt again } }; if (authToken && mediaServerType == MediaServerType.PLEX) {