fix: switch Jellyfin auth to use the Authorization header

fixes #317
This commit is contained in:
Lei Nelissen
2026-01-29 13:32:14 +01:00
parent 56cf35454e
commit d6823bb264
2 changed files with 17 additions and 6 deletions
@@ -122,7 +122,7 @@ const CredentialGenerator: React.FC<Props> = ({ serverUrl, onCredentialsRetrieve
// good
const response = await fetch(`${address}/Users/${userId}`, {
headers: {
'X-Emby-Authorization': `MediaBrowser Client="", Device="", DeviceId="", Version="", Token="${accessToken}"`
'Authorization': `MediaBrowser Client="", Device="", DeviceId="", Version="", Token="${accessToken}"`
}
});
+16 -5
View File
@@ -20,11 +20,22 @@ const deviceMap: Record<typeof Platform['OS'], string> = {
* Jellyfin server.
*/
function generateConfig(credentials: Credentials): RequestInit {
return {
headers: {
'X-Emby-Authorization': `MediaBrowser Client="Fintunes", Device="${deviceMap[Platform.OS]}", DeviceId="${credentials?.device_id}", Version="${version}", Token="${credentials?.access_token}"`
}
};
switch (credentials?.type) {
case 'jellyfin':
return {
headers: {
'Authorization': `MediaBrowser Client="Fintunes", Device="${deviceMap[Platform.OS]}", DeviceId="${credentials?.device_id}", Version="${version}", Token="${credentials?.access_token}"`
}
};
case 'emby':
return {
headers: {
'X-Emby-Authorization': `MediaBrowser Client="Fintunes", Device="${deviceMap[Platform.OS]}", DeviceId="${credentials?.device_id}", Version="${version}", Token="${credentials?.access_token}"`
}
};
default:
return {};
}
}
/**