mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 22:43:07 +03:00
Add upnp configuration
This commit is contained in:
@@ -189,7 +189,7 @@ namespace MediaBrowser.Api
|
||||
{
|
||||
throw new ArgumentNullException("xmlSerializer");
|
||||
}
|
||||
|
||||
|
||||
_xmlSerializer = xmlSerializer;
|
||||
_userManager = userManager;
|
||||
_dtoService = dtoService;
|
||||
@@ -306,6 +306,26 @@ namespace MediaBrowser.Api
|
||||
|
||||
var auth = AuthorizationRequestFilterAttribute.GetAuthorization(Request);
|
||||
|
||||
// Login in the old way if the header is missing
|
||||
if (string.IsNullOrEmpty(auth.Client) ||
|
||||
string.IsNullOrEmpty(auth.Device) ||
|
||||
string.IsNullOrEmpty(auth.DeviceId) ||
|
||||
string.IsNullOrEmpty(auth.Version))
|
||||
{
|
||||
var success = await _userManager.AuthenticateUser(user, request.Password).ConfigureAwait(false);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
// Unauthorized
|
||||
throw new UnauthorizedAccessException("Invalid user or password entered.");
|
||||
}
|
||||
|
||||
return new AuthenticationResult
|
||||
{
|
||||
User = _dtoService.GetUserDto(user)
|
||||
};
|
||||
}
|
||||
|
||||
var session = await _sessionMananger.AuthenticateNewSession(user, request.Password, auth.Client, auth.Version,
|
||||
auth.DeviceId, auth.Device, Request.RemoteIp).ConfigureAwait(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user