user dtos as strict object templates
Some checks failed
Build and Deploy API / build-and-deploy (push) Failing after 6s
Build and Deploy Frontend / build-and-deploy (push) Successful in 7s

This commit is contained in:
2026-03-20 21:08:32 -05:00
parent 7229e369ae
commit 109d5f88ea
7 changed files with 28 additions and 29 deletions

View File

@@ -22,9 +22,9 @@ public class AuthController : ControllerBase {
public async Task<ActionResult> Register(RegisterDto dto) {
var user = new User {
Name = dto.Username,
Email = "dummy@goofy.xyz",
Email = dto.Email,
PasswordHash = BCrypt.Net.BCrypt.HashPassword(dto.Password), // TODO: secondary hashing stage in client
Role = "admin (FOR NOW !!)",
Role = "user",
CreatedAt = DateTime.UtcNow // yeah why not utc
};

View File

@@ -1,15 +0,0 @@
public class RegisterDto {
public string Username { get; set; } = "";
public string Email { get; set; } = "";
public string Password { get; set; } = "";
}
public class LoginDto {
public string Username { get; set; } = "";
public string Password { get; set; } = "";
}

View File

@@ -7,7 +7,7 @@ public class User {
public string Name { get; set; } = "";
public string Email { get; set; } = "";
public string PasswordHash { get; set; } = "";
public string Role { get; set; }
public string Role { get; set; } = "";
public DateTime CreatedAt { get; set; }
};