Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] cors 설정 추가 #9

Merged
merged 2 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/main/java/kutaverse/manager/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package kutaverse.manager.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("GET", "POST", "PUT", "DELETE");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public String login(@ModelAttribute LoginRequest loginRequest, Model model, Http
cookie.setPath("/"); // 전체 경로에서 접근 가능
cookie.setMaxAge(60 * 60); // 쿠키 유효 기간 (1시간)
response.addCookie(cookie);
return "redirect:https://kutavers.xyz/manager-service/dashboard"; // 대시보드 페이지로 리다이렉트
return "redirect:https://kutaverse.xyz/manager-service/dashboard"; // 대시보드 페이지로 리다이렉트

}catch (Exception e){
model.addAttribute("error", "로그인 중 오류가 발생했습니다.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public String dashboard(Model model) {
@PostMapping("/user/ban/{userId}")
public String banUser(@PathVariable Long userId){
userServiceClient.banUser(userId);
return "redirect:https://kutavers.xyz/manager-service/dashboard";
return "redirect:https://kutaverse.xyz/manager-service/dashboard";
}

@GetMapping("/character-inventory")
Expand Down
Loading