forked from CIT/Vmeda.Online
		
	MOBILE-2478 desktop: Clear inappbrowser session on SSO
This commit is contained in:
		
							parent
							
								
									3a48f5d4a6
								
							
						
					
					
						commit
						6e026bd813
					
				| @ -43,7 +43,17 @@ export class InAppBrowserObjectMock { | |||||||
|         let width = 800, |         let width = 800, | ||||||
|             height = 600, |             height = 600, | ||||||
|             display; |             display; | ||||||
|         const bwOptions: any = {}; | 
 | ||||||
|  |         const bwOptions: any = { | ||||||
|  |                 webPreferences: {} | ||||||
|  |             }; | ||||||
|  | 
 | ||||||
|  |         try { | ||||||
|  |             // Create a separate session for inappbrowser so we can clear its data without affecting the app.
 | ||||||
|  |             bwOptions.webPreferences.session = require('electron').remote.session.fromPartition('inappbrowsersession'); | ||||||
|  |         } catch (ex) { | ||||||
|  |             // Ignore errors.
 | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         if (screen) { |         if (screen) { | ||||||
|             display = this.screen.getPrimaryDisplay(); |             display = this.screen.getPrimaryDisplay(); | ||||||
| @ -65,6 +75,9 @@ export class InAppBrowserObjectMock { | |||||||
|         if (options.indexOf('fullscreen=yes') != -1) { |         if (options.indexOf('fullscreen=yes') != -1) { | ||||||
|             bwOptions.fullscreen = true; |             bwOptions.fullscreen = true; | ||||||
|         } |         } | ||||||
|  |         if (options.indexOf('clearsessioncache=yes') != -1 && bwOptions.webPreferences.session) { | ||||||
|  |             bwOptions.webPreferences.session.clearStorageData({storages: 'cookies'}); | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         this.window = new this.browserWindow(bwOptions); |         this.window = new this.browserWindow(bwOptions); | ||||||
|         this.window.loadURL(url); |         this.window.loadURL(url); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user