Kontekst
Tworze mała aplikację używająć thymeleaf spirng boot do spring security dodałem dostęp do folderu resource i wszystko się ładne wyświetla. Problem zaczyna się przy wylogowywaniu. Nie ładuje zasobów i jest error "Refused to apply style from 'http://localhost:8080/login' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled"
login.html
<head th:fragment="head">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<base href="/">
<title>SB Admin - Dashboard</title>
<!-- Bootstrap core CSS-->
<link th:href="@{webjars/bootstrap/4.1.2/css/bootstrap.min.css}"
rel="stylesheet" type="text/css">
<!-- Custom fonts for this template-->
<link th:href="@{vendor/fontawesome-free/css/all.min.css}" rel="stylesheet" type="text/css">
<!-- Custom styles for this template-->
<link th:href="@{css/sb-admin.css}" rel="stylesheet" type="text/css">
</head>
<div th:fragment="js">
<script src="webjars/jquery/3.3.1/jquery.min.js"></script>
<script src="webjars/popper.js/1.14.1/umd/popper.min.js" type="text/javascript"></script>
<script src="webjars/bootstrap/4.1.2/js/bootstrap.min.js" type="text/javascript"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js" type="text/javascript"></script>
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js" type="text/javascript"></script>
<!-- Custom scripts for all pages-->
<script src="js/sb-admin.min.js" type="text/javascript"></script>
</div>
spring security
.authorizeRequests().antMatchers("/testUser").hasAnyRole("USER", "ADMIN", "SUPER")
.antMatchers("/testAdmin").hasAnyRole("ADMIN", "SUPER").antMatchers("/testSuper").hasAnyRole("SUPER")
.antMatchers("/", "/user/create", "/user/registrationConfirm", "/user/rememberPassword",
"/user/createNewPassword")
.permitAll().anyRequest().authenticated() // pozostale wymagaja po prostu zalogowania jako ktokolwiek
.and().formLogin().loginPage("/login").permitAll() // jakie zadanie ma byc wykonane kiedy wystapi
// koniecznosc
// logowania
.loginProcessingUrl("/app-login") // jaki zadanie ma zostac wykoanne po nacisnieciu submit formularza
// logowania
.usernameParameter("username") // pod jakim pramaetrem formularz logowania wysyla nazwe usera
.passwordParameter("password") // pod jakim parametrem formularz logowania wysyla haslo
.defaultSuccessUrl("/createLoginToken", true) // jakie zadanie ma sie wykonac kiedy podam dobry login
.failureUrl("/login/error") // jakie zadanie ma sie wykonac kiedy podam zly login
.and().logout().permitAll() // kazdy moze sie wylogowac
.logoutUrl("/app-logout") // takie zadanie ma byc wykonane po wylogowaniu
.clearAuthentication(true) // czyscimy uprawnienia usera
.logoutSuccessUrl("/login").permitAll() // po wylogowaniu mam sie wykonac takie zadanie
.and().exceptionHandling() // przechwytywanie wyjatkow logowania
.accessDeniedHandler(accessDeniedHandler())
.and().httpBasic(); // powyzssza konfiguracja przerobiona na specjalna postac // zrozumiala dla
// spring security
http.authorizeRequests().antMatchers("/resources/static/**").permitAll().anyRequest().authenticated();