fix(auth): resolve sign-in crashes and email authentication 500 error

- Refactored authentication calls in core__user.ts to explicitly set x-account-id and remove x-no-account-id, ensuring correct account context for legacy endpoints.
- Updated emailed sign-in link logic to use the correct /user/{user_id}/email_auth_key_url endpoint and avoid 500 crashes caused by extraneous URL parameters.
- Fixed person search query field names (enable/hide) and broadened search scope to 'all' to ensure records are found regardless of status.
- Added safety checks and documentation to prevent UI crashes when API responses are empty or NULL.
This commit is contained in:
Scott Idem
2026-01-15 14:03:49 -05:00
parent b88d5fbabf
commit 7ce9c5e093
2 changed files with 36 additions and 47 deletions

View File

@@ -488,6 +488,9 @@
// }
// WARNING: This function returns a list. We only want the first one. There should be no more than 1 record returned.
// WARNING: This function returns a list. We only want the first one. There should be no more than 1 record returned.
// We use enabled: 'all' and hidden: 'all' to ensure we find the person record even if
// technical fields like 'hide' are NULL or the record is temporarily disabled.
ae_promises['person'] = core_func
.load_ae_obj_li__person({
api_cfg: $ae_api,
@@ -501,6 +504,7 @@
log_lvl: 1
})
.then((person_response) => {
// Safety Check: Ensure the response is valid and contains at least one record before accessing index 0.
if (
person_response &&
person_response.length > 0 &&
@@ -591,6 +595,9 @@
// }
// WARNING: This function returns a list. We only want the first one. There should be no more than 1 record returned.
// WARNING: This function returns a list. We only want the first one. There should be no more than 1 record returned.
// We use enabled: 'all' and hidden: 'all' to ensure we find the person record even if
// technical fields like 'hide' are NULL or the record is temporarily disabled.
ae_promises['person'] = core_func
.load_ae_obj_li__person({
api_cfg: $ae_api,
@@ -604,6 +611,7 @@
log_lvl: 1
})
.then((person_response) => {
// Safety Check: Ensure the response is valid and contains at least one record before accessing index 0.
if (
person_response &&
person_response.length > 0 &&