Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I ctrl-click on the edit button, I need to authenticate again #687

Closed
almet opened this issue Oct 25, 2018 · 3 comments · Fixed by #3078
Closed

When I ctrl-click on the edit button, I need to authenticate again #687

almet opened this issue Oct 25, 2018 · 3 comments · Fixed by #3078
Assignees
Milestone

Comments

@almet
Copy link
Member

almet commented Oct 25, 2018

While trying to find a way to edit multiple records in batch, I've tried to open the edition form in as-many separate tabs as records I wanted to edit.

But when going to these newly created tabs, I'm presented with the authentication form (even if I'm already identified !)

@leplatrem
Copy link
Contributor

leplatrem commented Oct 26, 2018

We should use cookies instead of sessionStorage then

export function loadSession(): ?Object {
try {
return JSON.parse(sessionStorage.getItem(SESSION_KEY) || "null");
} catch (err) {
return null;
}
}
export function saveSession(sessionState: SessionState): Promise<any> {
sessionStorage.setItem(
SESSION_KEY,
JSON.stringify({
...sessionState,
buckets: [],
})
);
return Promise.resolve();
}

@n1k0
Copy link
Contributor

n1k0 commented Nov 7, 2019

There's a storage event you can subscribe to to listen for changes performed outside of the current page environment. It looks like this:

// Ensure session is refreshed when it changes in another tab/window
window.addEventListener("storage", (event) => {
  if (event.storageArea === sessionStorage && event.key === "myStoreKeyName") {
    updateSessionData(event.newValue);
  }
}, false);

@alexcottner
Copy link
Contributor

This is annoying me when testing things so I'm moving it into the current milestone

@alexcottner alexcottner added this to the OKR H2/2023 milestone Nov 15, 2023
@alexcottner alexcottner self-assigned this Nov 30, 2023
alexcottner added a commit that referenced this issue Dec 4, 2023
* Fixes #687 - switched sessionStorage for localStorage to persist auth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants