Skip to content

Commit

Permalink
regression: Handle live setting forget user session on window close u…
Browse files Browse the repository at this point in the history
…pdate (#33133)
  • Loading branch information
yash-rajpal authored Aug 26, 2024
1 parent ac08452 commit d4dde2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/meteor/client/startup/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ Accounts.onEmailVerificationLink((token: string) => {
});

Meteor.startup(() => {
Tracker.autorun(() => {
Tracker.autorun((computation) => {
const forgetUserSessionOnWindowClose = settings.get('Accounts_ForgetUserSessionOnWindowClose');

if (forgetUserSessionOnWindowClose === undefined) {
return;
}

computation.stop();

Accounts.config({ clientStorage: forgetUserSessionOnWindowClose ? 'session' : 'local' });
});
});

0 comments on commit d4dde2b

Please sign in to comment.