From a147315851488edf91c1497273e2ae22d6702542 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Thu, 11 Aug 2022 21:35:02 +0200 Subject: [PATCH] add transactionnal --- .../java/com/covas/Resources/TokenRessource.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/covas/Resources/TokenRessource.java b/src/main/java/com/covas/Resources/TokenRessource.java index 77ccf7d..41836ee 100644 --- a/src/main/java/com/covas/Resources/TokenRessource.java +++ b/src/main/java/com/covas/Resources/TokenRessource.java @@ -77,14 +77,14 @@ public class TokenRessource { users.connected_at = LocalDateTime.now(); users.persist(); return Response.status(Response.Status.CREATED).cookie(new NewCookie(new Cookie("jwt", newJwtCookie), "Token JWT", expires, false), new NewCookie(new Cookie("user", nameEncoded), "Username", expires, false)).build(); - } - // All mp.jwt and smallrye.jwt properties are still effective, only the verification key is customized. - try { - jwt = parser.parse(jwtCookie); - } - catch(ParseException p){ - return Response.status(Response.Status.GONE).build(); - } + } + // All mp.jwt and smallrye.jwt properties are still effective, only the verification key is customized. + try { + jwt = parser.parse(jwtCookie); + } + catch(ParseException p){ + return Response.status(Response.Status.GONE).build(); + } // or jwt = parser.decrypt(jwtCookie, secret); String kid = jwt.getClaim(Claims.kid).toString(); if(!kid.equals(users.id.toString())){