aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Users/UserManager.cs
diff options
context:
space:
mode:
authorthornbill <thornbill@users.noreply.github.com>2025-11-02 21:58:42 -0500
committerJoshua M. Boniface <joshua@boniface.me>2025-11-02 21:58:42 -0500
commit1ccd10863e24485978a2f5fd7650b2bcf42168d3 (patch)
treea873a6328861c1031fe7a7042674836ade24e406 /Jellyfin.Server.Implementations/Users/UserManager.cs
parent4258df4485c928e5a128bfb7c0149ba51b7b33af (diff)
Backport pull request #15254 from jellyfin/release-10.11.z
Update password reset to always return the same response structure Original-merge: 4ad31418753840ca76c52fc2aa56fa1a4235ca87 Merged-by: crobibero <cody@robibe.ro> Backported-by: Joshua M. Boniface <joshua@boniface.me>
Diffstat (limited to 'Jellyfin.Server.Implementations/Users/UserManager.cs')
-rw-r--r--Jellyfin.Server.Implementations/Users/UserManager.cs24
1 files changed, 12 insertions, 12 deletions
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs
index d0b41a7f6..b534ccd1b 100644
--- a/Jellyfin.Server.Implementations/Users/UserManager.cs
+++ b/Jellyfin.Server.Implementations/Users/UserManager.cs
@@ -508,23 +508,18 @@ namespace Jellyfin.Server.Implementations.Users
public async Task<ForgotPasswordResult> StartForgotPasswordProcess(string enteredUsername, bool isInNetwork)
{
var user = string.IsNullOrWhiteSpace(enteredUsername) ? null : GetUserByName(enteredUsername);
+ var passwordResetProvider = GetPasswordResetProvider(user);
+
+ var result = await passwordResetProvider
+ .StartForgotPasswordProcess(user, enteredUsername, isInNetwork)
+ .ConfigureAwait(false);
if (user is not null && isInNetwork)
{
- var passwordResetProvider = GetPasswordResetProvider(user);
- var result = await passwordResetProvider
- .StartForgotPasswordProcess(user, isInNetwork)
- .ConfigureAwait(false);
-
await UpdateUserAsync(user).ConfigureAwait(false);
- return result;
}
- return new ForgotPasswordResult
- {
- Action = ForgotPasswordAction.InNetworkRequired,
- PinFile = string.Empty
- };
+ return result;
}
/// <inheritdoc/>
@@ -760,8 +755,13 @@ namespace Jellyfin.Server.Implementations.Users
return GetAuthenticationProviders(user)[0];
}
- private IPasswordResetProvider GetPasswordResetProvider(User user)
+ private IPasswordResetProvider GetPasswordResetProvider(User? user)
{
+ if (user is null)
+ {
+ return _defaultPasswordResetProvider;
+ }
+
return GetPasswordResetProviders(user)[0];
}