From 5f4537dbf0d18a2e5e81438830f2bc1ac7a58533 Mon Sep 17 00:00:00 2001 From: Yash Rajpal <58601732+yash-rajpal@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:39:19 +0000 Subject: [PATCH] regression: Handle live setting forget user session on window close update (#33133) --- apps/meteor/client/startup/accounts.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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' }); }); });