mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: totp 2fa; httpcontext extension for jwtuser; asp.net data protection; prevent banned users from certain actions; account deletion requires 2fa if enabled; making users admins requires 2fa if enabled; httpcontext extension to get ip; enhance user store
refactor: organize dtos by domain; verification providers use verification context; move ip parsing into http context extensions chore: clean code
This commit is contained in:
@@ -14,18 +14,17 @@ namespace SharpbinV3.Server.Services.Verification
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
public async Task<bool> VerifyAsync(string? token, string? ip)
|
||||
public async Task<bool> VerifyAsync(VerificationContext context, IVerificationProvider? provider = null)
|
||||
{
|
||||
var provider = GetActiveProvider();
|
||||
var activeProvider = provider ?? GetActiveProvider();
|
||||
|
||||
if (provider is null)
|
||||
if (activeProvider is null)
|
||||
return true;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(token))
|
||||
if (string.IsNullOrWhiteSpace(context.Token))
|
||||
return false;
|
||||
|
||||
return await provider.VerifyAsync(token, ip);
|
||||
return await activeProvider.VerifyAsync(context);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user