mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix(plex): use unique client identifier (#2602)
* fix(plex): use unique client identifier As noted by SwiftPanda each client needs a unique identifier https://discord.com/channels/783137440809746482/793885156569514046/950083089575583824 * fix(typo): fix character casing Co-authored-by: TheCatLady <52870424+TheCatLady@users.noreply.github.com> Co-authored-by: TheCatLady <52870424+TheCatLady@users.noreply.github.com>
This commit is contained in:
@@ -34,12 +34,24 @@ class PlexOAuth {
|
||||
'Window is not defined. Are you calling this in the browser?'
|
||||
);
|
||||
}
|
||||
|
||||
let clientId = localStorage.getItem('overseerrPlexClientId');
|
||||
if (!clientId) {
|
||||
const uuid = crypto.randomUUID && crypto.randomUUID();
|
||||
if (!uuid) {
|
||||
throw new Error('Could not generate client ID');
|
||||
}
|
||||
|
||||
localStorage.setItem('overseerrPlexClientId', uuid);
|
||||
clientId = uuid;
|
||||
}
|
||||
|
||||
const browser = Bowser.getParser(window.navigator.userAgent);
|
||||
this.plexHeaders = {
|
||||
Accept: 'application/json',
|
||||
'X-Plex-Product': 'Overseerr',
|
||||
'X-Plex-Version': '2.0',
|
||||
'X-Plex-Client-Identifier': '7f9de3ba-e12b-11ea-87d0-0242ac130003',
|
||||
'X-Plex-Client-Identifier': clientId,
|
||||
'X-Plex-Model': 'Plex OAuth',
|
||||
'X-Plex-Platform': browser.getOSName(),
|
||||
'X-Plex-Platform-Version': browser.getOSVersion(),
|
||||
|
Reference in New Issue
Block a user