File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
java/com/caesarjlee/caesarfinancialtracker/configurations Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -34,14 +34,13 @@ public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws
3434 .sessionManagement (
3535 session -> session .sessionCreationPolicy (SessionCreationPolicy .STATELESS ))
3636 .authorizeHttpRequests (
37- authentication
38- -> authentication
39- .requestMatchers (HttpMethod .OPTIONS , "/**" )
40- .permitAll ()
41- .requestMatchers (HttpMethod .POST , "/api/alpha/profiles/register" , "/api/alpha/profiles/login" )// public endpoints
42- .permitAll ()
43- .anyRequest ()// everything else requires JWT
44- .authenticated ())
37+ authentication -> authentication
38+ .requestMatchers (HttpMethod .OPTIONS , "/**" )//allow CORS preflight for all endpoints
39+ .permitAll ()
40+ .requestMatchers (HttpMethod .POST , "/profiles/register" , "/profiles/login" )
41+ .permitAll ()
42+ .anyRequest ()// everything else requires JWT
43+ .authenticated ())
4544 .authenticationProvider (authenticationProvider ())
4645 .addFilterBefore (jwtAuthenticationFilter , UsernamePasswordAuthenticationFilter .class );// JWT filter
4746 return httpSecurity .build ();
Original file line number Diff line number Diff line change @@ -12,19 +12,16 @@ spring:
1212 properties :
1313 hibernate :
1414 format_sql : true # format SQL statements
15- # render injects show-sql, and show SQL statements 4 development
1615 show-sql : ${SHOW_SQL:false}
17- database-platform : ${SPRING_JPA_DATABASE_PLATFORM}
1816
1917server :
20- # render injects PORT, and use port 1989 for development
2118 port : ${PORT:1989} # memorize Tiananmen Square protests that happened in June 4, 1989
2219 servlet :
2320 context-path : /api/alpha # API path for version alpha
2421
2522app :
2623 cors :
27- allowed-origins : ${CORS_ALLOWED_ORIGINS:http://localhost:5173} # developed and deployed locations
24+ allowed-origins : ${CORS_ALLOWED_ORIGINS:http://localhost:5173}
2825
2926jwt :
3027 secret : ${JWT_SECRET}
You can’t perform that action at this time.
0 commit comments