This commit is contained in:
Yuri Kuznetsov
2022-09-23 15:49:08 +03:00
parent 25bcb9a49d
commit 895a2f7f2f
2 changed files with 32 additions and 10 deletions
+16 -5
View File
@@ -137,11 +137,7 @@ define('views/login-second-step', ['view'], function (Dep) {
.then(data => {
Espo.Ui.notify(false);
if (this.anotherUser) {
data.anotherUser = this.anotherUser;
}
this.trigger('login', userName, data);
this.triggerLogin(userName, data);
})
.catch(xhr => {
this.undisableForm();
@@ -152,6 +148,21 @@ define('views/login-second-step', ['view'], function (Dep) {
});
},
/**
* Trigger login to proceed to the application.
*
* @public
* @param {string} userName A username.
* @param {Object.<string, *>} data Data returned from the `App/user` request.
*/
triggerLogin: function (userName, data) {
if (this.anotherUser) {
data.anotherUser = this.anotherUser;
}
this.trigger('login', userName, data);
},
/**
* @private
*/
+16 -5
View File
@@ -170,11 +170,7 @@ define('views/login', ['view'], function (Dep) {
.then(data => {
Espo.Ui.notify(false);
if (this.anotherUser) {
data.anotherUser = this.anotherUser;
}
this.trigger('login', userName, data);
this.triggerLogin(userName, data);
})
.catch(xhr => {
this.undisableForm();
@@ -195,6 +191,21 @@ define('views/login', ['view'], function (Dep) {
});
},
/**
* Trigger login to proceed to the application.
*
* @public
* @param {string} userName A username.
* @param {Object.<string, *>} data Data returned from the `App/user` request.
*/
triggerLogin: function (userName, data) {
if (this.anotherUser) {
data.anotherUser = this.anotherUser;
}
this.trigger('login', userName, data);
},
/**
* @private
*/