Merge pull request #3509 from alfonso-salces/MOBILE-4081
MOBILE-4081 login-methods: Execute the first login methodmain
commit
84668aa639
|
@ -13,6 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { CoreLoginHelper, CoreLoginMethod } from '@features/login/services/login-helper';
|
import { CoreLoginHelper, CoreLoginMethod } from '@features/login/services/login-helper';
|
||||||
|
import { CoreSites } from '@services/sites';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'core-login-methods',
|
selector: 'core-login-methods',
|
||||||
|
@ -28,6 +29,12 @@ export class CoreLoginMethodsComponent implements OnInit {
|
||||||
*/
|
*/
|
||||||
async ngOnInit(): Promise<void> {
|
async ngOnInit(): Promise<void> {
|
||||||
this.loginMethods = await CoreLoginHelper.getLoginMethods();
|
this.loginMethods = await CoreLoginHelper.getLoginMethods();
|
||||||
|
const currentSite = CoreSites.getCurrentSite();
|
||||||
|
const defaultMethod = await CoreLoginHelper.getDefaultLoginMethod();
|
||||||
|
|
||||||
|
if (currentSite?.isLoggedOut() && defaultMethod) {
|
||||||
|
await defaultMethod.action();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1486,6 +1486,15 @@ export class CoreLoginHelperProvider {
|
||||||
return [];
|
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.
|
* Record that a password reset has been requested for a given site.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue