Skip to content

Commit

Permalink
add :: 기존 비밀번호와 새 비밀번호의 검사 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Umjiseung committed Mar 20, 2024
1 parent 1bece86 commit 364b01c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.msg.gauth.domain.auth.service

import com.msg.gauth.domain.auth.exception.PasswordAndNewPasswordSameException
import com.msg.gauth.domain.auth.exception.PasswordMismatchException
import com.msg.gauth.domain.auth.presentation.dto.request.PasswordUpdateRequestDto
import com.msg.gauth.domain.user.User
Expand All @@ -22,6 +23,10 @@ class UpdatePasswordService(
throw PasswordMismatchException()
}

if (passwordUpdateRequestDto.password == passwordUpdateRequestDto.newPassword) {
throw PasswordAndNewPasswordSameException()
}

val newPassword = passwordEncoder.encode(passwordUpdateRequestDto.newPassword)

val user = User(
Expand Down

0 comments on commit 364b01c

Please sign in to comment.