Skip to content

Commit

Permalink
Merge pull request #526 from Fallenbagel/fix-forget-password-button
Browse files Browse the repository at this point in the history
fix(jellyfinlogin): use externalHostname if set for forgetpassword link
  • Loading branch information
fallenbagel authored Nov 6, 2023
2 parents 9a7a98b + 405f6bb commit 364fb46
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions server/interfaces/api/settingsInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface SettingsAboutResponse {

export interface PublicSettingsResponse {
jellyfinHost?: string;
jellyfinExternalHost?: string;
jellyfinServerName?: string;
initialized: boolean;
applicationTitle: string;
Expand Down
2 changes: 2 additions & 0 deletions server/lib/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ interface FullPublicSettings extends PublicSettings {
originalLanguage: string;
mediaServerType: number;
jellyfinHost?: string;
jellyfinExternalHost?: string;
jellyfinServerName?: string;
partialRequestsEnabled: boolean;
cacheImages: boolean;
Expand Down Expand Up @@ -543,6 +544,7 @@ class Settings {
originalLanguage: this.data.main.originalLanguage,
mediaServerType: this.main.mediaServerType,
jellyfinHost: this.jellyfin.hostname,
jellyfinExternalHost: this.jellyfin.externalHostname,
partialRequestsEnabled: this.data.main.partialRequestsEnabled,
cacheImages: this.data.main.cacheImages,
vapidPublic: this.vapidPublic,
Expand Down
16 changes: 9 additions & 7 deletions src/components/Login/JellyfinLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
),
password: Yup.string(),
});

const mediaServerFormatValues = {
mediaServerName:
publicRuntimeConfig.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
Expand Down Expand Up @@ -218,6 +219,9 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
),
password: Yup.string(),
});
const baseUrl = settings.currentSettings.jellyfinExternalHost
? settings.currentSettings.jellyfinExternalHost
: settings.currentSettings.jellyfinHost;
return (
<div>
<Formik
Expand Down Expand Up @@ -294,13 +298,11 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
<Button
as="a"
buttonType="ghost"
href={
process.env.JELLYFIN_TYPE == 'emby'
? settings.currentSettings.jellyfinHost +
'/web/index.html#!/startup/forgotpassword.html'
: settings.currentSettings.jellyfinHost +
'/web/index.html#!/forgotpassword.html'
}
href={`${baseUrl}/web/index.html#!/${
process.env.JELLYFIN_TYPE === 'emby'
? 'startup/'
: ''
}forgotpassword.html`}
>
{intl.formatMessage(messages.forgotpassword)}
</Button>
Expand Down

0 comments on commit 364fb46

Please sign in to comment.