From 157e5951fca216d0d9a128c9cfcb889a4d7c7b3a Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Wed, 13 Mar 2024 19:14:22 +0100 Subject: [PATCH] =?UTF-8?q?ups=20je=20change=20un=20copi=C3=A9=20coll?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../herisson/Clyde/EndPoints/LoginController.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/LoginController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/LoginController.java index 5c04ebe..0b96535 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/LoginController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/LoginController.java @@ -2,6 +2,7 @@ package ovh.herisson.Clyde.EndPoints; import com.fasterxml.jackson.annotation.JsonFormat; import jakarta.persistence.Column; import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import ovh.herisson.Clyde.Responses.UnauthorizedResponse; @@ -49,19 +50,9 @@ public class LoginController { @PostMapping("/register") public ResponseEntity register(@RequestBody InscriptionRequest inscriptionRequest){ - authServ.register(inscriptionRequest); - - - String sessionToken = authServ.login(); - if (sessionToken == null){ - return new UnauthorizedResponse<>("Identifier or Password incorrect"); - } - - HttpHeaders responseHeaders = new HttpHeaders(); - responseHeaders.set("Set-Cookie",String.format("session_token=%s",sessionToken)); - return ResponseEntity.ok().headers(responseHeaders).build(); + return new ResponseEntity<>("Is OK", HttpStatus.OK); } }