Await update_auth_data to avoid races
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled

This commit is contained in:
jelveh
2026-02-24 18:33:30 -08:00
parent 0515b65138
commit 71f7698a46
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -476,7 +476,7 @@ async function UIDashboard (options) {
if ( l_user.username === window.user.username ) {
return;
}
window.update_auth_data(l_user.auth_token, l_user);
await window.update_auth_data(l_user.auth_token, l_user);
location.reload();
},
});
+1 -1
View File
@@ -2195,7 +2195,7 @@ $(document).on('click', '.user-options-menu-btn', async function (e) {
return;
}
// update auth data
window.update_auth_data(l_user.auth_token, l_user);
await window.update_auth_data(l_user.auth_token, l_user);
// refresh
location.reload();
},
+1 -1
View File
@@ -395,7 +395,7 @@ async function UIWindowLogin (options) {
await p;
window.update_auth_data(data.token, data.user);
await window.update_auth_data(data.token, data.user);
if ( options.reload_on_success ) {
window.onbeforeunload = null;
+1 -1
View File
@@ -158,7 +158,7 @@ async function UIWindowSaveAccount (options) {
success: async function (data) {
window.dispatchEvent(new CustomEvent('account-saved', { detail: { data: data } }));
window.update_auth_data(data.token, data.user);
await window.update_auth_data(data.token, data.user);
//close this window
if ( data.user.email_confirmation_required ) {
+2 -2
View File
@@ -147,7 +147,7 @@ async function UIWindowSessionList (options) {
$(el_window).find('.session-entry').on('click', function (e) {
$(el_window).find('.loading').css({ display: 'flex' });
setTimeout(() => {
setTimeout(async () => {
let selected_uuid = $(this).attr('data-uuid');
let selected_user;
for ( let index = 0; index < window.logged_in_users.length; index++ ) {
@@ -158,7 +158,7 @@ async function UIWindowSessionList (options) {
}
// new logged in user
window.update_auth_data(selected_user.auth_token, selected_user);
await window.update_auth_data(selected_user.auth_token, selected_user);
if ( options.reload_on_success ) {
// disable native browser exit confirmation
window.onbeforeunload = null;
+1 -1
View File
@@ -332,7 +332,7 @@ function UIWindowSignup (options) {
contentType: 'application/json',
data: JSON.stringify(requestData),
success: async function (data) {
window.update_auth_data(data.token, data.user);
await window.update_auth_data(data.token, data.user);
//send out the login event
if ( options.reload_on_success ) {