Fixes for username and password sign in! Quick save while Gemini still working.

This commit is contained in:
Scott Idem
2026-01-15 11:28:57 -05:00
parent 380e80ed7d
commit b88d5fbabf
3 changed files with 63 additions and 19 deletions

View File

@@ -115,15 +115,15 @@ export async function load_ae_obj_li__person({
}
if (enabled === 'enabled') {
search_query.and.push({ field: 'enabled', op: 'eq', value: true });
search_query.and.push({ field: 'enable', op: 'eq', value: true });
} else if (enabled === 'not_enabled') {
search_query.and.push({ field: 'enabled', op: 'eq', value: false });
search_query.and.push({ field: 'enable', op: 'eq', value: false });
}
if (hidden === 'hidden') {
search_query.and.push({ field: 'hidden', op: 'eq', value: true });
search_query.and.push({ field: 'hide', op: 'eq', value: true });
} else if (hidden === 'not_hidden') {
search_query.and.push({ field: 'hidden', op: 'eq', value: false });
search_query.and.push({ field: 'hide', op: 'eq', value: false });
}
promise = api.search_ae_obj_v3({

View File

@@ -33,6 +33,14 @@ export async function auth_ae_obj__username_password({
const endpoint = '/user/authenticate';
// Prepare API config with correct headers
const use_api_cfg = { ...api_cfg, headers: { ...api_cfg.headers } };
if (account_id) {
use_api_cfg.headers['x-account-id'] = account_id;
delete use_api_cfg.headers['x-no-account-id'];
params['account_id'] = account_id;
}
if (null_account_id) {
params['null_account_id'] = true;
}
@@ -45,7 +53,7 @@ export async function auth_ae_obj__username_password({
ae_promises.auth__username_password = await api
.get_object({
api_cfg: api_cfg,
api_cfg: use_api_cfg,
endpoint: endpoint,
params: params,
// data: {},
@@ -103,6 +111,14 @@ export async function auth_ae_obj__user_id_user_auth_key({
const endpoint = '/user/authenticate';
// Prepare API config with correct headers
const use_api_cfg = { ...api_cfg, headers: { ...api_cfg.headers } };
if (account_id) {
use_api_cfg.headers['x-account-id'] = account_id;
delete use_api_cfg.headers['x-no-account-id'];
params['account_id'] = account_id;
}
params['user_id'] = user_id; // Required
params['auth_key'] = user_auth_key; // Required
params['inc_jwt'] = true; // Request a JWT in the response
@@ -112,7 +128,7 @@ export async function auth_ae_obj__user_id_user_auth_key({
ae_promises.auth__user_id_user_key = await api
.get_object({
api_cfg: api_cfg,
api_cfg: use_api_cfg,
endpoint: endpoint,
params: params,
log_lvl: log_lvl
@@ -170,8 +186,17 @@ export async function send_email_auth_ae_obj__user_id({
root_url: base_url,
key_param_name: key_param_name
};
// Prepare API config with correct headers
const use_api_cfg = { ...api_cfg, headers: { ...api_cfg.headers } };
if (account_id) {
use_api_cfg.headers['x-account-id'] = account_id;
delete use_api_cfg.headers['x-no-account-id'];
params['account_id'] = account_id;
}
ae_promises.auth_key__send_email = await api.get_object({
api_cfg: api_cfg,
api_cfg: use_api_cfg,
endpoint: email_auth_key_endpoint,
params: params,
log_lvl: log_lvl
@@ -246,15 +271,24 @@ export async function qry_ae_obj_li__user_email({
const endpoint = '/user/lookup_email';
// Prepare API config with correct headers
const use_api_cfg = { ...api_cfg, headers: { ...api_cfg.headers } };
if (account_id) {
use_api_cfg.headers['x-account-id'] = account_id;
delete use_api_cfg.headers['x-no-account-id'];
params['account_id'] = account_id;
}
params['email'] = email; // Required
params['null_account_id'] = null_account_id || false;
if (log_lvl > 1) {
console.log(`qry_ae_obj_li__user_email() - params:`, params);
}
ae_promises.qry__user_email = await api
.get_object({
api_cfg: api_cfg,
api_cfg: use_api_cfg,
endpoint: endpoint,
params: params,
log_lvl: log_lvl