mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
fix subsonic login error: use status instead
This commit is contained in:
@@ -251,6 +251,9 @@ axiosClient.interceptors.response.use(
|
|||||||
message: data['subsonic-response'].error.message,
|
message: data['subsonic-response'].error.message,
|
||||||
title: i18n.t('error.genericError', { postProcess: 'sentenceCase' }) as string,
|
title: i18n.t('error.genericError', { postProcess: 'sentenceCase' }) as string,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Since we do status === 200, override this value with the error code
|
||||||
|
response.status = data['subsonic-response'].error.code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export const SubsonicController: ControllerEndpoint = {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
await ssApiClient({ server: null, url: cleanServerUrl }).authenticate({
|
const resp = await ssApiClient({ server: null, url: cleanServerUrl }).authenticate({
|
||||||
query: {
|
query: {
|
||||||
c: 'Feishin',
|
c: 'Feishin',
|
||||||
f: 'json',
|
f: 'json',
|
||||||
@@ -103,6 +103,10 @@ export const SubsonicController: ControllerEndpoint = {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (resp.status !== 200) {
|
||||||
|
throw new Error('Failed to log in');
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
credential,
|
credential,
|
||||||
userId: null,
|
userId: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user