From 160cfb0bbf1a07f68a7113b87063287c33a7bb2b Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Sat, 9 Mar 2024 18:41:20 +0100 Subject: [PATCH 1/3] 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) +} From 847936b799082589ba6c50d13cda0cbca2d37557 Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Sat, 16 Mar 2024 12:29:51 +0100 Subject: [PATCH 2/3] 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); } From 04f64f505e23bddf710c69214d59890a0efc9595 Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Sat, 16 Mar 2024 13:56:29 +0100 Subject: [PATCH 3/3] Indicated that you are logged by coloring the icon in orange and disconnect if clicked on it --- frontend/src/App.vue | 10 +++++++--- frontend/src/Apps/Login.vue | 5 ++++- frontend/src/rest/Users.js | 9 +++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 7b944de..1163b03 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -2,6 +2,7 @@ import { toast } from 'vue3-toastify'; import { ref, computed } from 'vue' import i18n, { setLang } from './i18n.js' + import { isLogged } from '@/rest/Users.js' // Liste des apps @@ -19,6 +20,7 @@ const currentPath = ref(window.location.hash) window.addEventListener('hashchange', () => { + Logged.value = isLogged(); currentPath.value = window.location.hash }) @@ -31,7 +33,9 @@ const settings=ref(i18n("app.settings")) const login=ref(i18n("app.login")) const active=ref(false) - + + const Logged = ref(isLogged()); +