Skip to content

Logout after import fixes#292

Closed
paigewilliams wants to merge 2 commits into
mainfrom
fix-importing-button
Closed

Logout after import fixes#292
paigewilliams wants to merge 2 commits into
mainfrom
fix-importing-button

Conversation

@paigewilliams

Copy link
Copy Markdown
Collaborator

Addresses the following bugs:

  1. [task] After a successful import and the user clicking "log out", the button in the modal would briefly display the "Importing..." spinner. I added logic to only display the spinner during the import step.
  2. [task]After a successful import, the intended functionality is for the user to be logged out to ensure that they see the latest database state. This was not happening consistently with location.reload(true);. I added a request to the logout url to ensure that a user is logged out.

@paigewilliams

Copy link
Copy Markdown
Collaborator Author

closing to open against develop

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes post-import UX and reliability around logging out from the import modal by ensuring the “Importing…” spinner is only shown during the import step and by explicitly hitting the logout endpoint before reloading the page.

Changes:

  • Add CSRF cookie helper and token retrieval for POSTing to /logout/.
  • Gate the “Importing…” spinner behind a showSpinner flag so it doesn’t appear during “Log out”.
  • Replace the prior “reload to log out” behavior with an explicit logout request followed by a reload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 165 to +169
$("#continueImport").html("Log out");
$("#continueImport").click(function () {
location.reload(true);
$.ajax({
url: "/logout/",
type: "POST",
Comment on lines +182 to 184
showSpinner = false;
resetModal();
}
Comment on lines 186 to 189
$("#modalNextSteps").html(unexpectedError(status));
showSpinner = false;
resetModal();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants