Merge pull request #3509 from alfonso-salces/MOBILE-4081

MOBILE-4081 login-methods: Execute the first login method
main
Noel De Martin 2022-12-15 12:06:32 +01:00 committed by GitHub
commit 84668aa639
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -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<void> {
this.loginMethods = await CoreLoginHelper.getLoginMethods();
const currentSite = CoreSites.getCurrentSite();
const defaultMethod = await CoreLoginHelper.getDefaultLoginMethod();
if (currentSite?.isLoggedOut() && defaultMethod) {
await defaultMethod.action();
}
}
}

View File

@ -1486,6 +1486,15 @@ export class CoreLoginHelperProvider {
return [];
}
/**
* Retrieve default login method.
*
* @returns Default login method.
*/
async getDefaultLoginMethod(): Promise<CoreLoginMethod | null> {
return null;
}
/**
* Record that a password reset has been requested for a given site.
*