fix(setup): fix Plex login not proceeding after authentication (#2596)

This commit is contained in:
fallenbagel
2026-03-04 03:22:01 +05:00
committed by GitHub
parent 9ec3d585d1
commit 1dc51542aa
2 changed files with 18 additions and 10 deletions

View File

@@ -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) {

View File

@@ -41,12 +41,17 @@ const SetupLogin: React.FC<LoginWithMediaServerProps> = ({
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) {