diff --git a/.gitignore b/.gitignore index 0dae5bf71e04e39098c8e94c8350bb61402a9743..f5d62d3d9ebbe763252e7507468f110736b1f0e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,28 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +# Project configuration +**/*.env* -# dependencies +# Project development +**/.idea +**/.vscode +**/.metals + +# Dependencies node_modules .pnp .pnp.js +yarn.lock* +package-lock.json* -# testing +# Testing coverage -# production +# Production build -# 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* -package-lock.json* \ No newline at end of file +# Misc +.DS_Store diff --git a/.metals/metals.h2.db b/.metals/metals.h2.db deleted file mode 100644 index 96d6858ab9ad7aecd35fb3dfa9feab354661eb7b..0000000000000000000000000000000000000000 Binary files a/.metals/metals.h2.db and /dev/null differ diff --git a/.metals/metals.log b/.metals/metals.log deleted file mode 100644 index a445e30c89c06eada409976ec757055b55b3b232..0000000000000000000000000000000000000000 --- a/.metals/metals.log +++ /dev/null @@ -1,23 +0,0 @@ -INFO time: initialize in 2.56s -WARN no build tool detected in workspace '/home/magnusanatolius/works/inra.paca.search'. The most common cause for this problem is that the editor was opened in the wrong working directory, for example if you use sbt then the workspace directory should contain build.sbt. -INFO started: Metals version 0.8.4 in workspace '/home/magnusanatolius/works/in-sylva.search.app' -INFO time: initialize in 4.02s -WARN resetting database: /home/magnusanatolius/works/in-sylva.search.app/.metals/metals.h2.db -WARN no build tool detected in workspace '/home/magnusanatolius/works/in-sylva.search.app'. The most common cause for this problem is that the editor was opened in the wrong working directory, for example if you use sbt then the workspace directory should contain build.sbt. -Apr 23, 2020 2:42:36 AM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify -INFO: Unsupported notification method: $/setTraceNotification -Apr 23, 2020 2:42:36 AM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify -INFO: Unsupported notification method: $/setTraceNotification -INFO shutting down Metals -INFO started: Metals version 0.8.4 in workspace '/home/magnusanatolius/works/in-sylva.search.app' -INFO time: initialize in 1.01s -WARN no build tool detected in workspace '/home/magnusanatolius/works/in-sylva.search.app'. The most common cause for this problem is that the editor was opened in the wrong working directory, for example if you use sbt then the workspace directory should contain build.sbt. -2020.08.27 16:41:31 INFO started: Metals version 0.9.3 in workspace '/home/bjaillet/works/in-sylva.search.app' for client vscode. -2020.08.27 16:41:32 INFO time: initialize in 0.86s -2020.08.27 16:41:36 WARN resetting database: /home/bjaillet/works/in-sylva.search.app/.metals/metals.h2.db -2020.08.27 16:41:36 WARN no build tool detected in workspace '/home/bjaillet/works/in-sylva.search.app'. The most common cause for this problem is that the editor was opened in the wrong working directory, for example if you use sbt then the workspace directory should contain build.sbt. -août 27, 2020 4:41:36 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify -INFO: Unsupported notification method: $/setTraceNotification -août 27, 2020 4:41:42 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify -INFO: Unsupported notification method: $/setTraceNotification -2020.08.27 16:41:50 INFO shutting down Metals diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index ae55f1b98509f01263b13206860dbe105503b92d..0000000000000000000000000000000000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "spellright.language": [ - "English (British)" - ], - "spellright.documentTypes": [ - "markdown", - "latex", - "plaintext" - ], - "codewindProfiling.showProfiling": false, - "files.watcherExclude": { - "**/target": true - } -} \ No newline at end of file diff --git a/src/context/UserContext.js b/src/context/UserContext.js index aff8ad3ea18f51ce75e5fb3692023afeaf3aa28d..2899346a4cacb859546964398d88d9fd1d63377c 100644 --- a/src/context/UserContext.js +++ b/src/context/UserContext.js @@ -69,25 +69,19 @@ function useUserDispatch() { return context; } -export { UserProvider, useUserState, useUserDispatch, checkUserLogin, refreshToken, signOut, verifyCallback }; - -// ########################################################### async function checkUserLogin(userId, accessToken, refreshToken) { - if (!!userId && !!accessToken && !!refreshToken) { sessionStorage.setItem("user_id", userId) sessionStorage.setItem("access_token", accessToken) sessionStorage.setItem("refresh_token", refreshToken) - - //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()) - + } // dispatch({ type: "USER_LOGGED_IN" }); } else { console.log('user not logged in') @@ -115,10 +109,6 @@ async function refreshToken() { } } -async function verifyCallback(recaptchaToken) { - console.log(recaptchaToken, "<= your recaptcha token") -} - async function signOut() { console.log('logout'); await ikcClient.logout({}); @@ -127,4 +117,6 @@ async function signOut() { sessionStorage.removeItem("refresh_token"); // dispatch({ type: "SIGN_OUT_SUCCESS" }); window.location.replace(loginUrl + '?requestType=search') -} \ No newline at end of file +} + +export { UserProvider, useUserState, useUserDispatch, checkUserLogin, refreshToken, signOut };