From 160cfb0bbf1a07f68a7113b87063287c33a7bb2b Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Sat, 9 Mar 2024 18:41:20 +0100 Subject: [PATCH 1/2] Page api stub --- frontend/src/rest/apps.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 frontend/src/rest/apps.js diff --git a/frontend/src/rest/apps.js b/frontend/src/rest/apps.js new file mode 100644 index 0000000..61fb716 --- /dev/null +++ b/frontend/src/rest/apps.js @@ -0,0 +1,9 @@ +import { restGet } from './restConsumer.js' + +export async function appList(){ + return restGet("/apps") +} + +export async function checkPage(page){ + return restGet("/apps/" + page) +} -- 2.46.0 From 847936b799082589ba6c50d13cda0cbca2d37557 Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Sat, 16 Mar 2024 12:29:51 +0100 Subject: [PATCH 2/2] fix tokens characters --- .../main/java/ovh/herisson/Clyde/Services/TokenService.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/TokenService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/TokenService.java index 50ddcbf..8c9e2d6 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Services/TokenService.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/TokenService.java @@ -9,6 +9,7 @@ import ovh.herisson.Clyde.Tables.User; import java.io.UnsupportedEncodingException; import java.security.SecureRandom; import java.util.ArrayList; +import java.util.Base64; import java.util.Calendar; import java.util.Date; @@ -30,13 +31,10 @@ public class TokenService { new SecureRandom().nextBytes(bytes); for (int i = 0; i < bytes.length; i++) { bytes[i] = (byte) (((bytes[i]+256)%256 %95+ 32)); - while ((char)bytes[i] == ';'){ - bytes[i] = new SecureRandom().generateSeed(1)[0]; - } } // will never end up in the catch because of the way that SecureRandom.nextBytes is implemented try { - return new String(bytes,"ISO_8859_1"); + return new String(Base64.getEncoder().encode(bytes),"ISO_8859_1"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } -- 2.46.0