Hi,
i try a new "method" for login ..
- back-end receive the request and process and find User and return the User.
- front-end : data is OK, and contain all info/preference of User
but i think : this.triggerLogin(null, data); is my issue or headers
so it "catch(xhr" ... but all is empty.
Can someone help ?
i try a new "method" for login ..
- back-end receive the request and process and find User and return the User.
- front-end : data is OK, and contain all info/preference of User
but i think : this.triggerLogin(null, data); is my issue or headers
so it "catch(xhr" ... but all is empty.
Can someone help ?
PHP Code:
const authString = btoa('**top:' + topBase64);
headers = {
'Authorization': 'Basic ' + authString,
'Espo-Authorization': authString,
'Espo-Authorization-Create-Token-Secret': 'true',
'X-TOP-Authentication': 'true'
};
Espo.Ajax.getRequest('App/user', null, {
login: true,
headers: headers
}).then(data => {
Espo.Ui.notify(false);
console.log('Authentication response:', data);
Espo.Ui.notify(false);
this.triggerLogin(null, data); // <---- Problem here for me
}).catch(xhr => {
console.log('Full error details:', {
status: xhr.status,
statusText: xhr.statusText,
responseText: xhr.responseText,
responseJSON: xhr.responseJSON
});
if (xhr.status === 401) {
Espo.Ui.warning('Authentication failed');
} else {
Espo.Ui.warning('Error occurred during login');
}
});
PHP Code:
{user: {…}, acl: {…}, preferences: {…}, token: '4e77a275fa0fd8ad9b864229fc74a087', settings: {…}, …}
acl
:
{table: {…}, fieldTable: {…}, assignmentPermission: 'all', messagePermission: 'all', mentionPermission: 'all', …}
appParams
:
{maxUploadSize: 64, isRestrictedMode: false, passwordChangeForNonAdminDisabled: true, timeZoneList: Array(2), auth2FARequired: false, …}
language
:
"en_US"
preferences
:
{id: '6435fb32a5ce98d96', timeZone: null, dateFormat: null, timeFormat: null, weekStart: -1, …}
settings
:
{systemUserAttributes: {…}, useCache: false, …}
token
:
"4e77a275fa0fd8ad9b864229fc74a087"
user
:
{id: '1234fb32a5ce98d96', name: 'Demo', deleted: false, userName: 'demo', type: 'regular', …