mirror of https://github.com/jellyfin/jellyfin.git
Use EventManager for AuthenticationSuccess, AuthenticationFailure (#8960)
This commit is contained in:
parent
769c48c629
commit
678bcf9a80
|
@ -95,12 +95,6 @@ namespace Emby.Server.Implementations.Session
|
||||||
_deviceManager.DeviceOptionsUpdated += OnDeviceManagerDeviceOptionsUpdated;
|
_deviceManager.DeviceOptionsUpdated += OnDeviceManagerDeviceOptionsUpdated;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public event EventHandler<GenericEventArgs<AuthenticationRequest>> AuthenticationFailed;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public event EventHandler<GenericEventArgs<AuthenticationResult>> AuthenticationSucceeded;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when playback has started.
|
/// Occurs when playback has started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1468,7 +1462,7 @@ namespace Emby.Server.Implementations.Session
|
||||||
|
|
||||||
if (user is null)
|
if (user is null)
|
||||||
{
|
{
|
||||||
AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request));
|
await _eventManager.PublishAsync(new GenericEventArgs<AuthenticationRequest>(request)).ConfigureAwait(false);
|
||||||
throw new AuthenticationException("Invalid username or password entered.");
|
throw new AuthenticationException("Invalid username or password entered.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1504,8 +1498,7 @@ namespace Emby.Server.Implementations.Session
|
||||||
ServerId = _appHost.SystemId
|
ServerId = _appHost.SystemId
|
||||||
};
|
};
|
||||||
|
|
||||||
AuthenticationSucceeded?.Invoke(this, new GenericEventArgs<AuthenticationResult>(returnResult));
|
await _eventManager.PublishAsync(new GenericEventArgs<AuthenticationResult>(returnResult)).ConfigureAwait(false);
|
||||||
|
|
||||||
return returnResult;
|
return returnResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,9 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
await UpdateUserInternalAsync(dbContext, user).ConfigureAwait(false);
|
await UpdateUserInternalAsync(dbContext, user).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
OnUserUpdated?.Invoke(this, new GenericEventArgs<User>(user));
|
var eventArgs = new UserUpdatedEventArgs(user);
|
||||||
|
await _eventManager.PublishAsync(eventArgs).ConfigureAwait(false);
|
||||||
|
OnUserUpdated?.Invoke(this, eventArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|
|
@ -57,16 +57,6 @@ namespace MediaBrowser.Controller.Session
|
||||||
/// </summary>
|
/// </summary>
|
||||||
event EventHandler<SessionEventArgs> CapabilitiesChanged;
|
event EventHandler<SessionEventArgs> CapabilitiesChanged;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Occurs when [authentication failed].
|
|
||||||
/// </summary>
|
|
||||||
event EventHandler<GenericEventArgs<AuthenticationRequest>> AuthenticationFailed;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Occurs when [authentication succeeded].
|
|
||||||
/// </summary>
|
|
||||||
event EventHandler<GenericEventArgs<AuthenticationResult>> AuthenticationSucceeded;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the sessions.
|
/// Gets the sessions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue