diff --git a/apps/meteor/client/startup/accounts.ts b/apps/meteor/client/startup/accounts.ts index 60f2de02bde0..88008a606656 100644 --- a/apps/meteor/client/startup/accounts.ts +++ b/apps/meteor/client/startup/accounts.ts @@ -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' }); }); });