Skip to content

Commit

Permalink
Store caseUrlHash in sessionStorage instead of localStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
esurface committed Aug 1, 2024
1 parent f6054f2 commit 75cda62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class SurveyLoginComponent implements OnInit {

async ngOnInit() {
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] ||
localStorage.getItem('caseUrlHash') ||
sessionStorage.getItem('caseUrlHash') ||
'forms-list';

if (await this.authenticationService.isLoggedIn()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export class TangyFormsPlayerComponent implements OnInit {
// Loading the formResponse from a case must happen before rendering the innerHTML
let formResponse;
if (this.caseId && this.caseEventId && this.eventFormId) {
// Store the caseUrlHash in localStorage so that we can redirect to the correct page after logout -> login
localStorage.setItem('caseUrlHash', `/case/event/form/${this.caseId}/${this.caseEventId}/${this.eventFormId}`);
// Store the caseUrlHash in sessionStorage so that we can redirect to the correct page after logout -> login
sessionStorage.setItem('caseUrlHash', `/case/event/form/${this.caseId}/${this.caseEventId}/${this.eventFormId}`);

try {
const groupId = window.location.pathname.split('/')[4];
Expand Down

0 comments on commit 75cda62

Please sign in to comment.