diff --git a/src/core/features/login/components/login-methods/login-methods.ts b/src/core/features/login/components/login-methods/login-methods.ts index 8e0654889..c4180647c 100644 --- a/src/core/features/login/components/login-methods/login-methods.ts +++ b/src/core/features/login/components/login-methods/login-methods.ts @@ -13,6 +13,7 @@ // limitations under the License. import { Component, OnInit } from '@angular/core'; import { CoreLoginHelper, CoreLoginMethod } from '@features/login/services/login-helper'; +import { CoreSites } from '@services/sites'; @Component({ selector: 'core-login-methods', @@ -28,6 +29,12 @@ export class CoreLoginMethodsComponent implements OnInit { */ async ngOnInit(): Promise { this.loginMethods = await CoreLoginHelper.getLoginMethods(); + const currentSite = CoreSites.getCurrentSite(); + const defaultMethod = await CoreLoginHelper.getDefaultLoginMethod(); + + if (currentSite?.isLoggedOut() && defaultMethod) { + await defaultMethod.action(); + } } } diff --git a/src/core/features/login/services/login-helper.ts b/src/core/features/login/services/login-helper.ts index cee8bec6a..b692af1a4 100644 --- a/src/core/features/login/services/login-helper.ts +++ b/src/core/features/login/services/login-helper.ts @@ -1486,6 +1486,15 @@ export class CoreLoginHelperProvider { return []; } + /** + * Retrieve default login method. + * + * @returns Default login method. + */ + async getDefaultLoginMethod(): Promise { + return null; + } + /** * Record that a password reset has been requested for a given site. *