mirror of
https://github.com/sct/overseerr.git
synced 2025-12-27 16:46:29 +01:00
fix(jellyfinlogin): use externalHostname if set for forgetpassword link
Implemented dynamic URL generation for the 'Forgot Password' feature. If jellyfin external hostname is set, the URL is generated based on it; otherwise, jellyfin hostname is used as the base URL. The URL includes additional parameters to handle emby support. fix #199, fix #424, re #212
This commit is contained in:
@@ -67,6 +67,7 @@ const JellyfinLogin: React.FC<JellyfinLoginProps> = ({
|
||||
),
|
||||
password: Yup.string(),
|
||||
});
|
||||
|
||||
const mediaServerFormatValues = {
|
||||
mediaServerName:
|
||||
publicRuntimeConfig.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin',
|
||||
@@ -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
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user