Private
Public Access
1
0

Add profile management (display name, email, password change, account deletion)

Full-stack profile section: DisplayName column on User model, profile CRUD
endpoints on AuthController, and complete Settings > Profile tab UI with
profile editing, password change, account info, and account deletion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-02-09 22:44:52 -05:00
parent 0562bb97b7
commit 1ceeca0fb6
12 changed files with 2250 additions and 175 deletions
@@ -43,4 +43,40 @@ public class AuthController : ControllerBase
await _authService.RevokeRefreshTokenAsync(userId);
return NoContent();
}
[Authorize]
[HttpGet("profile")]
public async Task<ActionResult<UserProfileResponse>> GetProfile()
{
var userId = Guid.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier)!);
var profile = await _authService.GetProfileAsync(userId);
return Ok(profile);
}
[Authorize]
[HttpPut("profile")]
public async Task<ActionResult<UserProfileResponse>> UpdateProfile(UpdateProfileRequest request)
{
var userId = Guid.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier)!);
var profile = await _authService.UpdateProfileAsync(userId, request);
return Ok(profile);
}
[Authorize]
[HttpPost("change-password")]
public async Task<ActionResult> ChangePassword(ChangePasswordRequest request)
{
var userId = Guid.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier)!);
await _authService.ChangePasswordAsync(userId, request);
return NoContent();
}
[Authorize]
[HttpDelete("account")]
public async Task<ActionResult> DeleteAccount()
{
var userId = Guid.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier)!);
await _authService.DeleteAccountAsync(userId);
return NoContent();
}
}