diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-01 23:05:36 +0200 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-01 23:05:36 +0200 |
| commit | 5b1091db276415fbf22a420fbe6cf9e34551f75b (patch) | |
| tree | 2c871647cfea0bd8479844fd93d1dd5c2b4ffbef /Emby.Server.Implementations/Session/SessionManager.cs | |
| parent | b8580e58aadbbef6f99dfc15ab0fcc38f5210dd8 (diff) | |
| parent | cc40f84f3c138e439318e400eeb53cbb74eb8a84 (diff) | |
Merge remote-tracking branch 'upstream/master' into do-not-instantiate-services-at-startup
Diffstat (limited to 'Emby.Server.Implementations/Session/SessionManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Session/SessionManager.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index dfcd3843c..de768333d 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -1401,6 +1401,16 @@ namespace Emby.Server.Implementations.Session user = _userManager.GetUserByName(request.Username); } + if (enforcePassword) + { + user = await _userManager.AuthenticateUser( + request.Username, + request.Password, + request.PasswordSha1, + request.RemoteEndPoint, + true).ConfigureAwait(false); + } + if (user == null) { AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request)); @@ -1413,16 +1423,6 @@ namespace Emby.Server.Implementations.Session throw new SecurityException("User is not allowed access from this device."); } - if (enforcePassword) - { - user = await _userManager.AuthenticateUser( - request.Username, - request.Password, - request.PasswordSha1, - request.RemoteEndPoint, - true).ConfigureAwait(false); - } - var token = GetAuthorizationToken(user, request.DeviceId, request.App, request.AppVersion, request.DeviceName); var session = LogSessionActivity( |
