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:
2026-01-07 16:36:41 -05:00
parent 361cf76f46
commit 20ceb91db8
46 changed files with 1568 additions and 162 deletions
+10
View File
@@ -0,0 +1,10 @@
namespace SharpbinV3.Server.DTOs.Auth
{
public class CreateJWT
{
public string? Token { get; set; }
public string? RefreshToken { get; set; }
public bool Success { get; set; }
public List<string>? Errors { get; set; }
}
}
@@ -0,0 +1,7 @@
namespace SharpbinV3.Server.DTOs.Auth
{
public class DisableTotpDto
{
public string Code { get; set; } = string.Empty;
}
}
@@ -0,0 +1,8 @@
namespace SharpbinV3.Server.DTOs.Auth
{
public sealed class EnableTotpDto
{
public string Secret { get; set; } = string.Empty;
public string Code { get; set; } = string.Empty;
}
}
@@ -0,0 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace SharpbinV3.Server.DTOs.Auth
{
public class RefreshTokenDto
{
[Required]
public required string Token { get; set; }
[Required]
public required string RefreshToken { get; set; }
}
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace SharpbinV3.Server.DTOs.Auth
{
public class TurnstileResponseDto
{
[JsonPropertyName("success")]
public bool Success { get; set; }
[JsonPropertyName("error-codes")]
public string[]? ErrorCodes { get; set; }
}
}