Skip to content

Commit

Permalink
fix : CORS 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
YASICJUNWOO committed Sep 5, 2023
1 parent eee275f commit 3451ab2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@CrossOrigin(origins = "http://localhost:3000")
@Controller
@RequiredArgsConstructor
@RequestMapping("/login")
Expand All @@ -28,4 +29,5 @@ public ResponseEntity<?> fail() {
logger.warn("로그인 실패");
return new ResponseEntity<>("로그인 실패",HttpStatus.EXPECTATION_FAILED);
}

}
7 changes: 2 additions & 5 deletions src/main/java/KJW/MBTIcoummunity/User/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;

import java.util.logging.Logger;

@CrossOrigin(origins = "http://localhost:3000")
@RestController
@RequiredArgsConstructor
public class UserController {
Expand Down

0 comments on commit 3451ab2

Please sign in to comment.