diff options
| author | crobibero <cody@robibe.ro> | 2020-09-03 07:46:52 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-09-03 07:46:52 -0600 |
| commit | fb422ff7411aaedb36d9cb90cc6cc61dd2859a0f (patch) | |
| tree | a40f3d83f025a8227bfcf64c9ad8c93828eb5ba3 /Emby.Server.Implementations/Session/SessionManager.cs | |
| parent | ae8ff1ca54fd5a4081c2e63a5ea1505ba0a69657 (diff) | |
| parent | a2d6ea2eed58b5cd1ecb519e3eda820f336d5485 (diff) | |
Merge remote-tracking branch 'upstream/master' into http-client-migrate
Diffstat (limited to 'Emby.Server.Implementations/Session/SessionManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Session/SessionManager.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index dad414142..ca8e0e29b 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -1429,6 +1429,24 @@ namespace Emby.Server.Implementations.Session return AuthenticateNewSessionInternal(request, false); } + public Task<AuthenticationResult> AuthenticateQuickConnect(AuthenticationRequest request, string token) + { + var result = _authRepo.Get(new AuthenticationInfoQuery() + { + AccessToken = token, + DeviceId = _appHost.SystemId, + Limit = 1 + }); + + if (result.TotalRecordCount == 0) + { + throw new SecurityException("Unknown quick connect token"); + } + + request.UserId = result.Items[0].UserId; + return AuthenticateNewSessionInternal(request, false); + } + private async Task<AuthenticationResult> AuthenticateNewSessionInternal(AuthenticationRequest request, bool enforcePassword) { CheckDisposed(); |
