This commit is contained in:
Yuri Kuznetsov
2024-09-05 11:03:17 +03:00
parent 105724140e
commit de105b35a4
+16 -2
View File
@@ -828,6 +828,21 @@ class App {
});
}
/**
* @typedef {Record} module:app~LoginData
* @property {Record} user
* @property {Record} preferences
* @property {Record} acl
* @property {Record} settings
* @property {Record} appParams
* @property {string} language
* @property {{
* userName: string,
* token: string,
* anotherUser?: string,
* }} auth
*/
/**
* @public
*/
@@ -835,7 +850,7 @@ class App {
this.auth = this.storage.get('user', 'auth') || null;
this.anotherUser = this.storage.get('user', 'anotherUser') || null;
this.baseController.on('login', data => {
this.baseController.on('login', /** module:app~LoginData */ data => {
const userId = data.user.id;
const userName = data.auth.userName;
const token = data.auth.token;
@@ -856,7 +871,6 @@ class App {
this.storage.set('user', 'anotherUser', this.anotherUser);
this.setCookieAuth(userName, token);
this.initUserData(data, () => this.onAuth(true));
});