Don't use database for QuickConnect

This commit is contained in:
Patrick Barron
2021-04-13 20:01:21 -04:00
parent ed0b5ff017
commit 75df6965a0
3 changed files with 38 additions and 59 deletions

View File

@@ -1441,24 +1441,6 @@ namespace Emby.Server.Implementations.Session
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");
}
var info = result.Items[0];
request.UserId = info.UserId;
// There's no need to keep the quick connect token in the database, as AuthenticateNewSessionInternal() issues a long lived token.
_authRepo.Delete(info);
return AuthenticateNewSessionInternal(request, false);
}