Merge pull request #3297 from alfonso-salces/MOBILE-4081

MOBILE-4081 sites: add logout without require auth again
main
Noel De Martin 2022-05-30 13:43:26 +02:00 committed by GitHub
commit 1d408b501f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -1353,14 +1353,15 @@ export class CoreSitesProvider {
* Mark a site as logged out so the user needs to authenticate again. * Mark a site as logged out so the user needs to authenticate again.
* *
* @param siteId ID of the site. * @param siteId ID of the site.
* @param isLoggedOut True if logged out and needs to authenticate again, false otherwise.
* @return Promise resolved when done. * @return Promise resolved when done.
*/ */
protected async setSiteLoggedOut(siteId: string): Promise<void> { async setSiteLoggedOut(siteId: string, isLoggedOut: boolean = true): Promise<void> {
const site = await this.getSite(siteId); 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 });
} }
/** /**