File tree Expand file tree Collapse file tree
Frontend/solarWatch/src/pages
solar-watch/src/main/java/com/codecool/solarwatch/security Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ const Login = () => {
2727
2828 if ( response ?. jwt ) {
2929 localStorage . setItem ( "jwt" , response . jwt ) ;
30+ console . log ( localStorage . getItem ( "jwt" ) ) ;
3031 setNotification ( {
3132 type : "success" ,
3233 message : "You Logged in" ,
Original file line number Diff line number Diff line change 11package com .codecool .solarwatch .security ;
22
3+ import com .codecool .solarwatch .model .Role ;
34import com .codecool .solarwatch .security .jwt .AuthEntryPointJwt ;
45import com .codecool .solarwatch .security .jwt .AuthTokenFilter ;
56import com .codecool .solarwatch .security .jwt .JwtUtils ;
@@ -66,6 +67,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
6667 .authorizeHttpRequests (auth ->
6768 auth .requestMatchers ("/api/user/**" ).permitAll ()
6869 .requestMatchers ("/error" ).permitAll ()
70+ .requestMatchers ("/api/report" ).hasRole ("USER" )
6971 .anyRequest ().authenticated ()
7072 );
7173
You can’t perform that action at this time.
0 commit comments