From f36d5dab05c6239c77a06fb1ea404a01335b1cd6 Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Wed, 13 Mar 2024 18:57:11 +0100 Subject: [PATCH] Putting the right configuration for cors --- .../main/java/ovh/herisson/Clyde/EndPoints/MockController.java | 2 +- .../main/java/ovh/herisson/Clyde/EndPoints/PingController.java | 2 +- .../java/ovh/herisson/Clyde/EndPoints/StorageController.java | 2 +- .../main/java/ovh/herisson/Clyde/EndPoints/TokenController.java | 2 +- .../main/java/ovh/herisson/Clyde/EndPoints/UserController.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java index b140057..f18dd34 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java @@ -18,7 +18,7 @@ import java.util.Calendar; import java.util.Date; @RestController -@CrossOrigin(origins = "http://localhost:5173") +@CrossOrigin(originPatterns = "*", allowCredentials = "true") public class MockController { private final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/PingController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/PingController.java index f0f26d3..b1148bf 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/PingController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/PingController.java @@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.RestController; import ovh.herisson.Clyde.Responses.PingResponse; @RestController -@CrossOrigin(origins = "http://localhost:5173") +@CrossOrigin(originPatterns = "*", allowCredentials = "true") public class PingController { @GetMapping("/ping") diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/StorageController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/StorageController.java index 2a36657..c8b4ae8 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/StorageController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/StorageController.java @@ -10,7 +10,7 @@ import org.springframework.core.io.Resource; import ovh.herisson.Clyde.Tables.FileType; @RestController -@CrossOrigin(origins = "http://localhost:5173") +@CrossOrigin(originPatterns = "*", allowCredentials = "true") public class StorageController { private final StorageService storageServ; diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/TokenController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/TokenController.java index 793e61b..ba07fca 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/TokenController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/TokenController.java @@ -9,7 +9,7 @@ import ovh.herisson.Clyde.Services.TokenService; import ovh.herisson.Clyde.Tables.Token; @RestController -@CrossOrigin(origins = "http://localhost:5173") +@CrossOrigin(originPatterns = "*", allowCredentials = "true") public class TokenController { private final TokenService tokenServ; diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java index 43bcd0c..df306ff 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java @@ -12,7 +12,7 @@ import ovh.herisson.Clyde.Tables.User; @RestController -@CrossOrigin(origins = "http://localhost:5173") +@CrossOrigin(originPatterns = "*", allowCredentials = "true") public class UserController { private final UserService userService; -- 2.46.0