Skip to content

Commit

Permalink
[FEATURE] E4-S3 회원가입 API - 로그인 전 로깅 #25
Browse files Browse the repository at this point in the history
  • Loading branch information
choisungwook committed Oct 8, 2021
1 parent 2e4f600 commit 1d8f25f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions backend/src/main/java/com/infp/ciat/user/entity/Account.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.infp.ciat.user.entity;

import com.infp.ciat.common.BaseTimeEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.*;

import javax.persistence.*;

Expand All @@ -15,6 +12,7 @@
@NoArgsConstructor
@Getter
@Entity
@ToString
public class Account extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.infp.ciat.user.entity.Role;
import com.infp.ciat.user.repository.AccountRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
Expand All @@ -16,6 +17,7 @@
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
@Slf4j
public class AccountService implements UserDetailsService {
private final AccountRepository accountRepository;
private final PasswordEncoder passwordEncoder;
Expand All @@ -42,7 +44,7 @@ public Long SignUp(SignupRequestDTO requestdto){
public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
Account find_user = accountRepository.findByEmail(email)
.orElseThrow(() -> new UsernameNotFoundException("사용자가 없습니다"));

log.debug(String.format("%s 계정 로그인 시도", email));
return AccountContext.FromAccountToAccountContext(find_user);
}
}

0 comments on commit 1d8f25f

Please sign in to comment.