diff --git a/.gitignore b/.gitignore index 88c87388cd8f1ea756ff3baed65d80f923a6d6db..f5d62d3d9ebbe763252e7507468f110736b1f0e1 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 diff --git a/src/context/UserContext.js b/src/context/UserContext.js index 2412f14e4faeb833f073e50f34b571d2d81e4240..cdcbb867583d22138da22d002baaff5443098419 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 };