Fixes for username and password sign in! Quick save while Gemini still working.
This commit is contained in:
@@ -220,7 +220,7 @@
|
||||
handle_send_auth_email({
|
||||
user_id: user_response.user_id_random
|
||||
});
|
||||
} else if (user_response.length > 0) {
|
||||
} else if (user_response && user_response.length > 0) {
|
||||
console.log(`Multiple users found for email:`, user_response);
|
||||
handle_send_auth_email({
|
||||
user_id: user_response[0].user_id_random
|
||||
@@ -452,7 +452,7 @@
|
||||
})
|
||||
.then((user_response) => {
|
||||
// console.log(`HERE:`, user_response);
|
||||
if (user_response.user_id_random) {
|
||||
if (user_response?.user_id_random) {
|
||||
console.log(
|
||||
`Successfully authenticated in with User ID and User Auth Key: ${user_response.username}`,
|
||||
user_response
|
||||
@@ -461,7 +461,7 @@
|
||||
user_id = user_obj.user_id_random; // Use the user_id_random for further API calls
|
||||
// person_id = user_obj.person_id_random;
|
||||
} else {
|
||||
alert('Failed to authenticate: ' + user_response.error);
|
||||
alert('Failed to authenticate: ' + (user_response?.error || 'Unknown error'));
|
||||
}
|
||||
})
|
||||
.then((response) => {
|
||||
@@ -494,12 +494,18 @@
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: $ae_loc.account_id,
|
||||
qry_user_id: user_id, // The user_id_random from the above authentication
|
||||
enabled: 'all',
|
||||
hidden: 'all',
|
||||
// params_json: params_json,
|
||||
// params: params,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then((person_response) => {
|
||||
if (person_response[0].person_id_random) {
|
||||
if (
|
||||
person_response &&
|
||||
person_response.length > 0 &&
|
||||
person_response[0].person_id_random
|
||||
) {
|
||||
console.log(
|
||||
`Successfully loaded person for user_id_random (${user_id}):`,
|
||||
person_response[0]
|
||||
@@ -510,8 +516,7 @@
|
||||
trigger = true; // Set trigger to true to indicate we can now sign in
|
||||
} else {
|
||||
alert(
|
||||
'Failed to load person information: ' +
|
||||
person_response.error
|
||||
'Failed to load person information. No person record found for this user.'
|
||||
);
|
||||
}
|
||||
})
|
||||
@@ -550,7 +555,7 @@
|
||||
log_lvl: 1
|
||||
})
|
||||
.then((user_response) => {
|
||||
if (user_response.user_id_random) {
|
||||
if (user_response?.user_id_random) {
|
||||
console.log(
|
||||
`Successfully authenticated in with Username (${user_response.username}) and Password:`,
|
||||
user_response
|
||||
@@ -559,7 +564,7 @@
|
||||
user_id = user_obj.user_id_random; // Use the user_id_random for further API calls
|
||||
// person_id = user_obj.person_id_random;
|
||||
} else {
|
||||
alert('Failed to authenticate: ' + user_response.error);
|
||||
alert('Failed to authenticate: ' + (user_response?.error || 'Unknown error'));
|
||||
}
|
||||
})
|
||||
.then((response) => {
|
||||
@@ -592,12 +597,18 @@
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: $ae_loc.account_id,
|
||||
qry_user_id: user_id, // The user_id_random from the above authentication
|
||||
enabled: 'all',
|
||||
hidden: 'all',
|
||||
// params_json: params_json,
|
||||
// params: params,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then((person_response) => {
|
||||
if (person_response[0].person_id_random) {
|
||||
if (
|
||||
person_response &&
|
||||
person_response.length > 0 &&
|
||||
person_response[0].person_id_random
|
||||
) {
|
||||
console.log(
|
||||
`Successfully loaded person for user_id_random (${user_id}):`,
|
||||
person_response[0]
|
||||
@@ -608,8 +619,7 @@
|
||||
trigger = true; // Set trigger to true to indicate we can now sign in
|
||||
} else {
|
||||
alert(
|
||||
'Failed to load person information: ' +
|
||||
person_response.error
|
||||
'Failed to load person information. No person record found for this user.'
|
||||
);
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user