Merge pull request #3007 from dpalou/MOBILE-3941

MOBILE-3941 login: Don't open browser if URL set and QR button
main
Pau Ferrer Ocaña 2021-11-26 14:18:21 +01:00 committed by GitHub
commit e3807c8a5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -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(