@@ -71,6 +71,7 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
7171 protected loginSuccessful = false ;
7272 protected username = '' ;
7373 protected alwaysShowLoginFormObserver ?: CoreEventObserver ;
74+ protected loginObserver ?: CoreEventObserver ;
7475
7576 constructor (
7677 protected fb : FormBuilder ,
@@ -81,6 +82,11 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
8182 this . credForm = fb . group ( {
8283 password : [ '' , Validators . required ] ,
8384 } ) ;
85+
86+ // Listen to LOGIN event to determine if login was successful, since the login can be done using QR, biometric, etc.
87+ this . loginObserver = CoreEvents . on ( CoreEvents . LOGIN , ( ) => {
88+ this . loginSuccessful = true ;
89+ } ) ;
8490 }
8591
8692 /**
@@ -151,10 +157,12 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
151157 {
152158 config : this . siteConfig ,
153159 loginSuccessful : this . loginSuccessful ,
160+ siteId : this . siteId ,
154161 } ,
155162 this . siteId ,
156163 ) ;
157164 this . alwaysShowLoginFormObserver ?. off ( ) ;
165+ this . loginObserver ?. off ( ) ;
158166 }
159167
160168 /**
@@ -190,7 +198,7 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
190198
191199 if ( ! this . eventThrown && ! this . viewLeft ) {
192200 this . eventThrown = true ;
193- CoreEvents . trigger ( CoreEvents . LOGIN_SITE_CHECKED , { config : this . siteConfig } ) ;
201+ CoreEvents . trigger ( CoreEvents . LOGIN_SITE_CHECKED , { config : this . siteConfig , siteId : this . siteId } ) ;
194202 }
195203
196204 this . isBrowserSSO = CoreLoginHelper . isSSOLoginNeeded ( this . siteConfig . typeoflogin ) ;
@@ -261,8 +269,6 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
261269 this . credForm . controls [ 'password' ] . reset ( ) ;
262270
263271 // Go to the site initial page.
264- this . loginSuccessful = true ;
265-
266272 await CoreNavigator . navigateToSiteHome ( {
267273 params : this . redirectData ,
268274 } ) ;
0 commit comments