Skip to content

Commit

Permalink
fix: check email 컨트롤러 이동, jwt필터 수정, config 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jeong011010 committed Oct 18, 2024
1 parent 2f9d9ff commit db6625a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
if (request.getRequestURI().equals("/api/v1/signup") ||
request.getRequestURI().equals("/api/v1/login") ||
request.getRequestURI().equals("/api/v1/auth/verify-email") ||
request.getRequestURI().equals("/api/v1/checkEmail") ||
request.getRequestURI().equals("/api/v1/auth/checkEmail") ||
request.getRequestURI().equals("/api/v1/auth/validate-email")
){
chain.doFilter(request, response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ public class AuthController {
@Autowired
private EmailVerificationTokenRepository emailVerificationTokenRepository;

@PostMapping("/checkEmail")
public void checkEmail(@RequestParam String email) {

// 이메일 인증 토큰 생성 및 이메일 발송
emailService.sendVerificationEmail(email);
}

@PostMapping("/signup")
public ResponseEntity<String> registerUser(@RequestBody @Valid UserRequest userRequest, BindingResult bindingResult, HttpServletRequest request ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http, JwtRequestFilt
authorize
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.requestMatchers("/","/api/v1/signup", "/api/v1/login",
"/api/v1/users/validate-username", "/api/v1/users/validate-email", "/api/v1/checkEmail",
"/swagger-resources/**", "/swagger-ui/**","/swagger-ui/index.html", "/v3/api-docs/**", "/api/v1/auth/verify-email", "/api/v1/auth/validate-email").permitAll()
"/api/v1/users/validate-username", "/api/v1/users/validate-email", "/api/v1/auth/**",
"/swagger-resources/**", "/swagger-ui/**","/swagger-ui/index.html", "/v3/api-docs/**").permitAll()
.requestMatchers("/api/v1/admin/users/{username}/role").hasRole("MASTER")
.requestMatchers("/api/v1/admin/**" ).hasAnyRole("ADMIN", "MASTER")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ public EmailController(EmailService emailService) {
this.emailService = emailService;
}

@PostMapping("/checkEmail")
public void checkEmail(@RequestParam String email) {

// 이메일 인증 토큰 생성 및 이메일 발송
emailService.sendVerificationEmail(email);
}

@GetMapping("/verify-email")
public ResponseEntity<String> verifyEmail(@RequestParam("token") String token) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/chekirout
username: root
password: root1234
password: rlawjdgns10!
p6spy:
enabled: true
appender: com.p6spy.engine.spy.appender.Slf4JLogger
Expand Down

0 comments on commit db6625a

Please sign in to comment.