MOBILE-3941 login: Don't open browser if URL set and QR button
This commit is contained in:
		
							parent
							
								
									8925e5ccb4
								
							
						
					
					
						commit
						63ce74ab91
					
				| @ -94,7 +94,7 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy { | ||||
| 
 | ||||
|         if (this.isFixedUrlSet || !this.siteConfig) { | ||||
|             // Fixed URL or not siteConfig retrieved from params, we need to check if it uses browser SSO login.
 | ||||
|             this.checkSite(this.siteUrl); | ||||
|             this.checkSite(this.siteUrl, true); | ||||
|         } else { | ||||
|             this.siteChecked = true; | ||||
|             this.pageLoaded = true; | ||||
| @ -128,9 +128,10 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy { | ||||
|      * This should be used only if a fixed URL is set, otherwise this check is already performed in CoreLoginSitePage. | ||||
|      * | ||||
|      * @param siteUrl Site URL to check. | ||||
|      * @param onInit Whether the check site is done when initializing the page. | ||||
|      * @return Promise resolved when done. | ||||
|      */ | ||||
|     protected async checkSite(siteUrl: string): Promise<void> { | ||||
|     protected async checkSite(siteUrl: string, onInit = false): Promise<void> { | ||||
|         this.pageLoaded = false; | ||||
| 
 | ||||
|         // If the site is configured with http:// protocol we force that one, otherwise we use default mode.
 | ||||
| @ -149,6 +150,11 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy { | ||||
|                 // SSO. User needs to authenticate in a browser.
 | ||||
|                 this.isBrowserSSO = true; | ||||
| 
 | ||||
|                 if (this.showScanQR && onInit) { | ||||
|                     // Don't open browser automatically, let the user view the scan QR button.
 | ||||
|                     return; | ||||
|                 } | ||||
| 
 | ||||
|                 // Check that there's no SSO authentication ongoing and the view hasn't changed.
 | ||||
|                 if (!CoreApp.isSSOAuthenticationOngoing() && !this.viewLeft) { | ||||
|                     CoreLoginHelper.confirmAndOpenBrowserForSSOLogin( | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user