- PasswordForgotRequestDto, PasswordResetRequestDto 생성 - IAuthService에 ForgotPasswordAsync, ResetPasswordAsync 추가 - ForgotPasswordAsync: UUID 토큰 생성 → ITokenStore 저장(30분) → 이메일 발송 - ResetPasswordAsync: 토큰 검증 → BCrypt 해싱 → 비밀번호 저장 - PasswordController 생성 (v1/in/account/password) - 보안: forgot에서 이메일 미존재 시에도 동일한 성공 응답
21 lines
788 B
C#
21 lines
788 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace SPMS.Application.DTOs.Account;
|
|
|
|
public class PasswordResetRequestDto
|
|
{
|
|
[Required(ErrorMessage = "이메일은 필수입니다.")]
|
|
[EmailAddress(ErrorMessage = "올바른 이메일 형식이 아닙니다.")]
|
|
public string Email { get; set; } = string.Empty;
|
|
|
|
[Required(ErrorMessage = "재설정 토큰은 필수입니다.")]
|
|
[JsonPropertyName("reset_token")]
|
|
public string ResetToken { get; set; } = string.Empty;
|
|
|
|
[Required(ErrorMessage = "새 비밀번호는 필수입니다.")]
|
|
[MinLength(8, ErrorMessage = "비밀번호는 8자 이상이어야 합니다.")]
|
|
[JsonPropertyName("new_password")]
|
|
public string NewPassword { get; set; } = string.Empty;
|
|
}
|