Skip to content

Commit 29d8d5e

Browse files
committed
Hotfix
1 parent 2634f0f commit 29d8d5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backend/src/main/java/com/youdemy/security/RestSecurityConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ public AuthenticationManager authenticationManagerBean() throws Exception {
4848
protected void configure(HttpSecurity http) throws Exception {
4949

5050
http.antMatcher("/api/**");
51-
52-
// Other URLs can be accessed without authentication
53-
http.authorizeRequests().anyRequest().permitAll();
5451

5552
// URLs that need authentication to access to it
5653
http.authorizeRequests().antMatchers(HttpMethod.POST, "/api/courses/**").hasAnyRole("TEACHER", "ADMIN");
5754
http.authorizeRequests().antMatchers(HttpMethod.DELETE, "/api/courses/**").hasAnyRole("TEACHER", "ADMIN");
5855

5956
http.authorizeRequests().antMatchers(HttpMethod.DELETE, "/api/orders/**").hasRole("ADMIN");
6057

58+
// Other URLs can be accessed without authentication
59+
http.authorizeRequests().anyRequest().permitAll();
60+
6161
// Disable CSRF protection (it is difficult to implement in REST APIs)
6262
http.csrf().disable();
6363

0 commit comments

Comments
 (0)