From e273143545791823bbfc0430215accb6045e6f9d Mon Sep 17 00:00:00 2001 From: rbisson <remi.bisson@inrae.fr> Date: Mon, 12 Feb 2024 09:36:21 +0100 Subject: [PATCH 1/2] [.gitignore]: improved comments, file organization and added dev folders --- .gitignore | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 88c8738..f5d62d3 100755 --- a/.gitignore +++ b/.gitignore @@ -1,30 +1,28 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +# Project configuration +**/*.env* -# dependencies -.metals +# Project development +**/.idea +**/.vscode +**/.metals + +# Dependencies node_modules -build .pnp .pnp.js -.idea +yarn.lock* +package-lock.json* - -# testing +# Testing coverage -# production +# Production build -node_modules -# misc -.DS_Store -# .env -.env.local -.env.development.local -.env.test.local -.env.production.local +# Project logs npm-debug.log* yarn-debug.log* yarn-error.log* -yarn.lock -.env + +# Misc +.DS_Store -- GitLab From 55226e6cafad6e819730dd1f3961cc5e9c3c0173 Mon Sep 17 00:00:00 2001 From: rbisson <remi.bisson@inrae.fr> Date: Mon, 12 Feb 2024 16:02:28 +0100 Subject: [PATCH 2/2] [UserContext.js]: removed old unused recaptcha token verification function --- src/context/UserContext.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/context/UserContext.js b/src/context/UserContext.js index 2412f14..cdcbb86 100644 --- a/src/context/UserContext.js +++ b/src/context/UserContext.js @@ -65,30 +65,24 @@ function useUserDispatch() { } async function checkUserLogin(userId, accessToken, refreshToken, roleId) { - if (!!userId && !!accessToken && !!refreshToken && !!roleId) { sessionStorage.setItem("userId", userId) sessionStorage.setItem("access_token", accessToken) sessionStorage.setItem("refresh_token", refreshToken) sessionStorage.setItem("roleId", roleId) - //To Do: + //To Do: // Load the user histories from UserHistory(userId) endpoint // Load the user result filters from Result_Filter(userId) endpoints // Load the user policies from Policy(userId) endpoint - if (!sessionStorage.getItem("token_refresh_time")) + if (!sessionStorage.getItem("token_refresh_time")) { sessionStorage.setItem("token_refresh_time", Date.now()) - + } } else { console.log('user not logged in') - } } -async function verifyCallback(recaptchaToken) { - console.log(recaptchaToken, "<= your recaptcha token") -} - async function signOut(dispatch, history) { await kcClient.logout({}); dispatch({ type: "SIGN_OUT_SUCCESS" }); @@ -100,4 +94,4 @@ async function signOut(dispatch, history) { redirect(loginUrl + '?requestType=portal') } -export { UserProvider, useUserState, useUserDispatch, signOut, verifyCallback, checkUserLogin }; \ No newline at end of file +export { UserProvider, useUserState, useUserDispatch, signOut, checkUserLogin }; -- GitLab