From 1fbb4f8fcb44f3508dc5274cf7b8e66807fb0fc9 Mon Sep 17 00:00:00 2001 From: geek Date: Fri, 18 Aug 2017 14:54:30 +0900 Subject: [PATCH] modify pw --- .../overflow/module/member/service/MemberService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/loafle/overflow/module/member/service/MemberService.java b/src/main/java/com/loafle/overflow/module/member/service/MemberService.java index 5f0ec1a..c8ab4c3 100644 --- a/src/main/java/com/loafle/overflow/module/member/service/MemberService.java +++ b/src/main/java/com/loafle/overflow/module/member/service/MemberService.java @@ -72,6 +72,14 @@ public class MemberService { public Member modify(Member member) { + Member preMember = this.memberDAO.findByEmail(member.getEmail()); + + BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); + Boolean match = passwordEncoder.matches(member.getPw(), preMember.getPw()); + if(!match) { + throw new SignInPwNotMatchException(); + } + return this.memberDAO.save(member); }