Skip to content

Commit

Permalink
chore : 401 에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoya324 committed Sep 13, 2024
1 parent 94cc789 commit e2f77c9
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
public class SecurityConfig {

private static final String API_PREFIX = "/api";
private static final String ADMIN_API_PREFIX = "/api/admin";

private final LoginService loginService;
private final JwtService jwtService;
Expand Down Expand Up @@ -68,13 +69,7 @@ public SecurityFilterChain filterChain(HttpSecurity http, HandlerMappingIntrospe
.permitAll()
.requestMatchers(new MvcRequestMatcher(introspector, API_PREFIX + "/question/**"))
.permitAll()
.requestMatchers(new MvcRequestMatcher(introspector, API_PREFIX + "/admin/answers/**"))
.hasRole("ADMIN")
.requestMatchers(new MvcRequestMatcher(introspector, API_PREFIX + "/admin/questions/**"))
.hasRole("ADMIN")
.requestMatchers(new MvcRequestMatcher(introspector, API_PREFIX + "/admin/questions/status/**"))
.hasRole("ADMIN")
.requestMatchers(new MvcRequestMatcher(introspector, API_PREFIX + "/admin/questions/status"))
.requestMatchers(new MvcRequestMatcher(introspector, ADMIN_API_PREFIX + "/**"))
.hasRole("ADMIN")
.requestMatchers(new MvcRequestMatcher(introspector, "/maru-egg/api-docs/**"))
.permitAll()
Expand Down

0 comments on commit e2f77c9

Please sign in to comment.