refactor: clean code
This commit is contained in:
@ -75,7 +75,7 @@ public class AuthController(IOptionsSnapshot<Admin> user, IOptionsSnapshot<Gener
|
||||
|
||||
if (userId != null)
|
||||
{
|
||||
userEntity.OAuthProviders ??= new Dictionary<OAuthProvider, OAuthUser>();
|
||||
userEntity.OAuthProviders ??= [];
|
||||
|
||||
if (!userEntity.OAuthProviders.TryAdd(provider, oAuthUser))
|
||||
{
|
||||
@ -105,7 +105,7 @@ public class AuthController(IOptionsSnapshot<Admin> user, IOptionsSnapshot<Gener
|
||||
TwoFactorAuthenticator = userEntity.TwoFactorAuthenticator,
|
||||
SecondFactorToken = userEntity.Secret,
|
||||
OAuthProviders = userEntity.OAuthProviders
|
||||
}, provider);
|
||||
});
|
||||
|
||||
title = "Успешный вход в аккаунт.";
|
||||
message = "Вы успешно вошли в свою учетную запись. Добро пожаловать!";
|
||||
@ -152,7 +152,7 @@ public class AuthController(IOptionsSnapshot<Admin> user, IOptionsSnapshot<Gener
|
||||
[MaintenanceModeIgnore]
|
||||
public ActionResult<List<AvailableOAuthProvidersResponse>> AvailableProviders() =>
|
||||
Ok(oAuthService
|
||||
.GetAvailableProviders(HttpContext, HttpContext.GetApiUrl(Url.Action("AuthorizeOAuth2")!))
|
||||
.GetAvailableProviders(HttpContext.GetApiUrl(Url.Action("AuthorizeOAuth2")!))
|
||||
.ConvertToDto());
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user