mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
Add quick connect
This commit is contained in:
@@ -1386,6 +1386,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 < 1)
|
||||
{
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user