|
@@ -16,6 +16,8 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
|
import org.springframework.security.web.SecurityFilterChain;
|
|
import org.springframework.security.web.SecurityFilterChain;
|
|
|
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
|
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
|
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
|
|
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
|
|
|
|
|
|
|
@Configuration
|
|
@Configuration
|
|
|
@EnableWebSecurity
|
|
@EnableWebSecurity
|
|
@@ -38,7 +40,7 @@ class SecurityConfiguration {
|
|
|
.httpBasic(Customizer.withDefaults())
|
|
.httpBasic(Customizer.withDefaults())
|
|
|
.headers(headers -> headers.frameOptions(frameOptionsConfig -> frameOptionsConfig.sameOrigin()))//liberar o banco
|
|
.headers(headers -> headers.frameOptions(frameOptionsConfig -> frameOptionsConfig.sameOrigin()))//liberar o banco
|
|
|
.authorizeHttpRequests(auth -> auth
|
|
.authorizeHttpRequests(auth -> auth
|
|
|
- .requestMatchers("/login", "/images/**", "/css/**", "/error/**", "/").permitAll()
|
|
|
|
|
|
|
+ .requestMatchers("/login", "/images/**", "/css/**", "/error/**", "/", "/api/company/register-with-user").permitAll()
|
|
|
.requestMatchers(HttpMethod.POST, "/authentication/login").permitAll()
|
|
.requestMatchers(HttpMethod.POST, "/authentication/login").permitAll()
|
|
|
.requestMatchers("/auth/**").permitAll()
|
|
.requestMatchers("/auth/**").permitAll()
|
|
|
.requestMatchers("/api/**").authenticated()
|
|
.requestMatchers("/api/**").authenticated()
|