MOBILE-4081 sites: add logout without require auth again
parent
c535b723ca
commit
1cd9100a56
|
@ -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 });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue