-
-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plex-login): use application name for plex product name on login #3811
base: develop
Are you sure you want to change the base?
feat(plex-login): use application name for plex product name on login #3811
Conversation
The application title should probably just completely replace the default title of "Overseerr", without the dash. This is how we do it throughout the rest of the app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of many ways to fix this up @OwsleyJr , if all looks good you should be able to accept my suggests and merge.
const authToken = await plexOAuth.login( | ||
settings.currentSettings.applicationTitle | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const authToken = await plexOAuth.login( | |
settings.currentSettings.applicationTitle | |
); | |
const authToken = await plexOAuth.login( | |
settings.currentSettings.applicationTitle || 'Overseerr' | |
); |
@@ -40,8 +40,11 @@ class PlexOAuth { | |||
private popup?: Window; | |||
|
|||
private authToken?: string; | |||
private DEFAULT_APPLICATION_NAME = 'Overseerr'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private DEFAULT_APPLICATION_NAME = 'Overseerr'; |
public initializeHeaders( | ||
applicationName = this.DEFAULT_APPLICATION_NAME | ||
): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public initializeHeaders( | |
applicationName = this.DEFAULT_APPLICATION_NAME | |
): void { | |
public initializeHeaders(applicationName): void { |
const plexProductName = | ||
applicationName === this.DEFAULT_APPLICATION_NAME | ||
? applicationName | ||
: `${applicationName} - ${this.DEFAULT_APPLICATION_NAME}`; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const plexProductName = | |
applicationName === this.DEFAULT_APPLICATION_NAME | |
? applicationName | |
: `${applicationName} - ${this.DEFAULT_APPLICATION_NAME}`; |
const browser = Bowser.getParser(window.navigator.userAgent); | ||
this.plexHeaders = { | ||
Accept: 'application/json', | ||
'X-Plex-Product': 'Overseerr', | ||
'X-Plex-Product': plexProductName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'X-Plex-Product': plexProductName, | |
'X-Plex-Product': applicationName, |
Description
Update the Plex OAuth flow to include the application name. This allows for a tad more customization and authenticating users not being concerned about what "Overseerr" is. The plex product name shows on the plex login screen as shown in the screenshots below.
If the application name is the default
Overseerr
the plex product name will beOverseerr
If the application name is not the default it will be
${applicationName} - Overseerr
.Screenshot (if UI-related)
Default name of
Overseerr
Application name of
My Server
To-Dos
yarn build
yarn i18n:extract