From 1cd9100a56d72dbdfabceb97ef306487d5e9f780 Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Mon, 30 May 2022 10:18:01 +0200 Subject: [PATCH] MOBILE-4081 sites: add logout without require auth again --- src/core/services/sites.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/services/sites.ts b/src/core/services/sites.ts index 9cddd8b96..c27c1783a 100644 --- a/src/core/services/sites.ts +++ b/src/core/services/sites.ts @@ -1353,14 +1353,15 @@ export class CoreSitesProvider { * Mark a site as logged out so the user needs to authenticate again. * * @param siteId ID of the site. + * @param isLoggedOut True if logged out and needs to authenticate again, false otherwise. * @return Promise resolved when done. */ - protected async setSiteLoggedOut(siteId: string): Promise { + async setSiteLoggedOut(siteId: string, isLoggedOut: boolean = true): Promise { const site = await this.getSite(siteId); - site.setLoggedOut(true); + site.setLoggedOut(isLoggedOut); - await this.sitesTable.update({ loggedOut: 1 }, { id: siteId }); + await this.sitesTable.update({ loggedOut: isLoggedOut ? 1 : 0 }, { id: siteId }); } /**