mirror of
https://github.com/bitwarden/server
synced 2025-12-11 22:03:38 +00:00
refactor(login-features) [PM-24211]: Remove Core.LoginFeatures as no longer used; AuthRequest.IsValidForAuthentication should be used for any applicable use cases.
This commit is contained in:
@@ -1,14 +0,0 @@
|
|||||||
using Bit.Core.Auth.LoginFeatures.PasswordlessLogin;
|
|
||||||
using Bit.Core.Auth.LoginFeatures.PasswordlessLogin.Interfaces;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
|
|
||||||
namespace Bit.Core.Auth.LoginFeatures;
|
|
||||||
|
|
||||||
public static class LoginServiceCollectionExtensions
|
|
||||||
{
|
|
||||||
public static void AddLoginServices(this IServiceCollection services)
|
|
||||||
{
|
|
||||||
services.AddScoped<IVerifyAuthRequestCommand, VerifyAuthRequestCommand>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Bit.Core.Auth.LoginFeatures.PasswordlessLogin.Interfaces;
|
|
||||||
|
|
||||||
public interface IVerifyAuthRequestCommand
|
|
||||||
{
|
|
||||||
Task<bool> VerifyAuthRequestAsync(Guid authRequestId, string accessCode);
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
using Bit.Core.Auth.LoginFeatures.PasswordlessLogin.Interfaces;
|
|
||||||
using Bit.Core.Repositories;
|
|
||||||
using Bit.Core.Utilities;
|
|
||||||
|
|
||||||
namespace Bit.Core.Auth.LoginFeatures.PasswordlessLogin;
|
|
||||||
|
|
||||||
public class VerifyAuthRequestCommand : IVerifyAuthRequestCommand
|
|
||||||
{
|
|
||||||
private readonly IAuthRequestRepository _authRequestRepository;
|
|
||||||
|
|
||||||
public VerifyAuthRequestCommand(IAuthRequestRepository authRequestRepository)
|
|
||||||
{
|
|
||||||
_authRequestRepository = authRequestRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<bool> VerifyAuthRequestAsync(Guid authRequestId, string accessCode)
|
|
||||||
{
|
|
||||||
var authRequest = await _authRequestRepository.GetByIdAsync(authRequestId);
|
|
||||||
if (authRequest == null || !CoreHelpers.FixedTimeEquals(authRequest.AccessCode, accessCode))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -21,7 +21,6 @@ using Bit.Core.Auth.Enums;
|
|||||||
using Bit.Core.Auth.Identity;
|
using Bit.Core.Auth.Identity;
|
||||||
using Bit.Core.Auth.Identity.TokenProviders;
|
using Bit.Core.Auth.Identity.TokenProviders;
|
||||||
using Bit.Core.Auth.IdentityServer;
|
using Bit.Core.Auth.IdentityServer;
|
||||||
using Bit.Core.Auth.LoginFeatures;
|
|
||||||
using Bit.Core.Auth.Models.Business.Tokenables;
|
using Bit.Core.Auth.Models.Business.Tokenables;
|
||||||
using Bit.Core.Auth.Repositories;
|
using Bit.Core.Auth.Repositories;
|
||||||
using Bit.Core.Auth.Services;
|
using Bit.Core.Auth.Services;
|
||||||
@@ -140,7 +139,6 @@ public static class ServiceCollectionExtensions
|
|||||||
services.AddScoped<IAuthRequestService, AuthRequestService>();
|
services.AddScoped<IAuthRequestService, AuthRequestService>();
|
||||||
services.AddScoped<IDuoUniversalTokenService, DuoUniversalTokenService>();
|
services.AddScoped<IDuoUniversalTokenService, DuoUniversalTokenService>();
|
||||||
services.AddScoped<ISendAuthorizationService, SendAuthorizationService>();
|
services.AddScoped<ISendAuthorizationService, SendAuthorizationService>();
|
||||||
services.AddLoginServices();
|
|
||||||
services.AddScoped<IOrganizationDomainService, OrganizationDomainService>();
|
services.AddScoped<IOrganizationDomainService, OrganizationDomainService>();
|
||||||
services.AddVaultServices();
|
services.AddVaultServices();
|
||||||
services.AddReportingServices();
|
services.AddReportingServices();
|
||||||
|
|||||||
Reference in New Issue
Block a user