From b2e5ac8eea08d6b8b26e3c596ed30d1711894c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20K=C3=A1bele?= Date: Wed, 5 Aug 2026 11:05:11 +0200 Subject: [PATCH] fix authentication code --- frontend/src/services/PlexService.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/frontend/src/services/PlexService.tsx b/frontend/src/services/PlexService.tsx index e784cf7..c6ed219 100644 --- a/frontend/src/services/PlexService.tsx +++ b/frontend/src/services/PlexService.tsx @@ -7,11 +7,17 @@ export const createAuthPin = async ( clientIdentifier: string, ): Promise => { try { - const response = await axios.postForm(`${PLEX_API_URL}/pins`, { - strong: 'true', - 'X-Plex-Product': PLEX_PRODUCT_NAME, - 'X-Plex-Client-Identifier': clientIdentifier, - }); + const response = await axios.postForm( + `${PLEX_API_URL}/pins`, + { + strong: 'true', + 'X-Plex-Product': PLEX_PRODUCT_NAME, + 'X-Plex-Client-Identifier': clientIdentifier, + }, + { + headers: { Accept: 'application/json' }, + }, + ); return response.data; } catch (error) { @@ -30,6 +36,7 @@ export const getAuthToken = async ( code: authPin.code, 'X-Plex-Client-Identifier': clientIdentifier, }, + headers: { Accept: 'application/json' }, }); return response.data.authToken; } catch (error) { @@ -49,6 +56,7 @@ export const getPlexUser = async ( 'X-Plex-Client-Identifier': clientIdentifier, 'X-Plex-Token': token, }, + headers: { Accept: 'application/json' }, }); if (response.status !== 200) { @@ -74,6 +82,7 @@ export const getPlexServers = async ( 'X-Plex-Token': token, 'X-Plex-Client-Identifier': clientIdentifier, }, + headers: { Accept: 'application/json' }, }); if (!response.data || !Array.isArray(response.data)) {