Skip to content
Snippets Groups Projects
Commit fc756f0a authored by Kristiane Skogvang Kolshus's avatar Kristiane Skogvang Kolshus
Browse files

Remove token method

parent 9cbc7f1f
Branches main master
No related tags found
1 merge request!52Final changes
Pipeline #270180 passed
......@@ -76,26 +76,9 @@ public class SecurityConfiguration {
return httpSecurity
.csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(auth -> {
auth.requestMatchers(
"/api/auth/",
"/api/quiz/quiz/",
"/api/quiz/",
"/api/quiz/difficulty",
"/api/quiz/category",
"/api/questions/allQuestionsToAQuiz/",
auth.requestMatchers("/api/auth/**",
"/v3/api-docs/",
"/swagger-ui/").permitAll();
auth.requestMatchers(
"/api/quiz/delete/",
"/api/quiz/update",
"/api/quiz/create").hasAnyRole("USER", "ADMIN");
auth.requestMatchers(
"/api/questions/delete/",
"/api/questions/update",
"/api/questions/get/").hasAnyRole("USER", "ADMIN");
auth.requestMatchers(
"/api/user/getId/**",
"/api/user/").hasAnyRole("USER", "ADMIN");
auth.anyRequest().authenticated();
})
......
......@@ -5,15 +5,15 @@ export const apiClient = axios.create({
baseURL: 'http://localhost:8080/api',
//TODO: set api URL
});
/*
apiClient.interceptors.request.use(
(config) => {
const token = getToken();
if(token) {
config.headers['Authorization'] = `Bearer ${token}`;
}
}else
return config;
},
(error) => {
return Promise.reject("Problem with token: " + error);
});
\ No newline at end of file
//return Promise.reject("Problem with token: " + error);
});*/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment