forked from EVOgeek/Vmeda.Online
		
	MOBILE-3965 login: Always force logout when click 'Logout' button
This commit is contained in:
		
							parent
							
								
									85eaeb44fe
								
							
						
					
					
						commit
						5ec817e7f5
					
				| @ -169,7 +169,7 @@ export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy { | |||||||
|     async logout(event: Event): Promise<void> { |     async logout(event: Event): Promise<void> { | ||||||
|         await this.close(event); |         await this.close(event); | ||||||
| 
 | 
 | ||||||
|         CoreSites.logout(); |         CoreSites.logout(true); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | |||||||
| @ -1181,9 +1181,10 @@ export class CoreSitesProvider { | |||||||
|     /** |     /** | ||||||
|      * Logout the user. |      * Logout the user. | ||||||
|      * |      * | ||||||
|  |      * @param forceLogout If true, site will be marked as logged out, no matter the value tool_mobile_forcelogout. | ||||||
|      * @return Promise resolved when the user is logged out. |      * @return Promise resolved when the user is logged out. | ||||||
|      */ |      */ | ||||||
|     async logout(): Promise<void> { |     async logout(forceLogout = false): Promise<void> { | ||||||
|         if (!this.currentSite) { |         if (!this.currentSite) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -1194,7 +1195,7 @@ export class CoreSitesProvider { | |||||||
| 
 | 
 | ||||||
|         this.currentSite = undefined; |         this.currentSite = undefined; | ||||||
| 
 | 
 | ||||||
|         if (siteConfig && siteConfig.tool_mobile_forcelogout == '1') { |         if (forceLogout || (siteConfig && siteConfig.tool_mobile_forcelogout == '1')) { | ||||||
|             promises.push(this.setSiteLoggedOut(siteId)); |             promises.push(this.setSiteLoggedOut(siteId)); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| @ -1222,7 +1223,7 @@ export class CoreSitesProvider { | |||||||
|             CoreApp.storeRedirect(siteId, redirectData); |             CoreApp.storeRedirect(siteId, redirectData); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         await CoreSites.logout(); |         await this.logout(); | ||||||
| 
 | 
 | ||||||
|         return CoreSitePlugins.hasSitePluginsLoaded; |         return CoreSitePlugins.hasSitePluginsLoaded; | ||||||
|     } |     } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user