Skip to content

Commit

Permalink
Merge pull request #1035 from sennetconsortium/libpitt/1029-redirect
Browse files Browse the repository at this point in the history
Move page saving logic after deleteCookies - #1029
  • Loading branch information
maxsibilla authored Nov 14, 2023
2 parents 634e365 + b0fcc36 commit 877dc53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/context/AppContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ export const AppProvider = ({ cache, children }) => {
useEffect(() => {
// Should only include: '/', '/search', '/logout', '/login', '/404'
const noRedirectTo = Object.values(APP_ROUTES)
if (noRedirectTo.indexOf(router.pathname) === -1) {
// Set expiry for 10 minutes
setLocalItemWithExpiry(pageKey, router.asPath, 600000)
}

let info = getCookie('info')
let groups_token = ""
Expand All @@ -58,6 +54,11 @@ export const AppProvider = ({ cache, children }) => {
deleteCookies()
}

if (noRedirectTo.indexOf(router.pathname) === -1) {
// Set expiry for 10 minutes
setLocalItemWithExpiry(pageKey, router.asPath, 600000)
}

if(groups_token != "") {
check_valid_token().then((response) => {
if (typeof response == "boolean") {
Expand Down
2 changes: 1 addition & 1 deletion src/search-ui

0 comments on commit 877dc53

Please sign in to comment.