Release v1.0.0 #16

Merged
Wesser merged 492 commits from release/v1.0.0 into master 2025-02-12 09:19:32 +03:00
286 changed files with 15122 additions and 99 deletions
Showing only changes of commit c75ac60b0b - Show all commits

View File

@ -183,8 +183,18 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService, I
public Task<TwoFactorAuthenticator> LoginOAuthAsync(CookieOptions cookieOptions, public Task<TwoFactorAuthenticator> LoginOAuthAsync(CookieOptions cookieOptions,
HttpContext context, HttpContext context,
User user, User user,
CancellationToken cancellation = default) => OAuthUser oAuthUser,
LoginAsync(cookieOptions, context, user, cancellation); OAuthProvider provider,
CancellationToken cancellation = default)
{
if (user.OAuthProviders == null || !user.OAuthProviders.TryGetValue(provider, out var value))
throw new SecurityException($"This provider '{Enum.GetName(provider)}' is not linked to the account.");
if (value.Id != oAuthUser.Id)
throw new SecurityException("This account was not linked");
return LoginAsync(cookieOptions, context, user, cancellation);
}
public async Task<TwoFactorAuthenticator> LoginAsync(CookieOptions cookieOptions, public async Task<TwoFactorAuthenticator> LoginAsync(CookieOptions cookieOptions,
HttpContext context, HttpContext context,