mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 00:20:45 +00:00
Fix missing password entry (#2632)
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
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
* Revert "dev(oidc): hide unnecessary div"
This reverts commit 468558f8dc.
* fix(oidc): remove the "You will be asked to..." box properly
Earlier this was removed with a simple `display: none` in CSS to avoid
changing any logic, and the reason for that was OIDC had already gone
through significant testing, re-testing, and bug fixes; it became clear
that changes to the auth flow are fragile and the test surface is very
large. Now unfortunately what seemed like a smart decision to fix a
cosmetic issue with CSS instead of updating logic actually wound up
breaking the change username/password flow for non-OIDC users. This
commit removes this box properly and hopefully does not introduce a
subsequent terrible bug. Why would it? There's absolutely no reason I
can see that it would, but it would seem that nothing is safe, not even
CSS.
* temp: disable LRU cache of homepage for now
This is working fine but we're disabling it temporarily so we can test
specific future changes in isolation without managing two separate
branches.
* fix: put verify password text in the box
There's always something...
This commit is contained in:
@@ -17,12 +17,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import { encode } from 'html-entities';
|
||||
import { LRUCache } from 'lru-cache';
|
||||
import fs from 'node:fs';
|
||||
import { is_valid_url } from '../helpers.js';
|
||||
import { Endpoint } from '../util/expressutil.js';
|
||||
import { PathBuilder } from '../util/pathutil.js';
|
||||
import BaseService from './BaseService.js';
|
||||
import fs from 'node:fs';
|
||||
import { LRUCache } from 'lru-cache';
|
||||
/**
|
||||
* PuterHomepageService serves the initial HTML page that loads the Puter GUI
|
||||
* and all of its assets.
|
||||
@@ -194,7 +194,14 @@ export class PuterHomepageService extends BaseService {
|
||||
},
|
||||
});
|
||||
|
||||
this.#outputCache.set(cacheKey, outputHTML);
|
||||
// TODO: we will re-enable this shortly (within 24 hours)
|
||||
//
|
||||
// It is currently disabled so that we can determine the impact on
|
||||
// performance of b687ba0 (not b687ba0 specifically but the subsequent
|
||||
// fixed version of b687ba0) in isolation without confounding
|
||||
// variables.
|
||||
//
|
||||
// this.#outputCache.set(cacheKey, outputHTML);
|
||||
|
||||
res.send(outputHTML);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ async function UIWindowChangeEmail (options) {
|
||||
h += `<input id="confirm-new-email-${internal_id}" type="text" name="new-email" class="new-email" autocomplete="off" />`;
|
||||
h += '</div>';
|
||||
// password / OIDC revalidate
|
||||
h += '<div class="change-email-auth-row" style="display: none; overflow: hidden; margin-top: 10px; margin-bottom: 30px;">';
|
||||
h += '<div class="change-email-auth-row" style="overflow: hidden; margin-top: 10px; margin-bottom: 30px;">';
|
||||
h += '<div class="change-email-password-wrap">';
|
||||
h += `<label>${i18n('account_password')}</label>`;
|
||||
h += `${place_password_entry.html}`;
|
||||
@@ -86,11 +86,7 @@ async function UIWindowChangeEmail (options) {
|
||||
const authRow = $(this_window).find('.change-email-auth-row');
|
||||
if ( oidc_only ) {
|
||||
authRow.find('.change-email-password-wrap').hide();
|
||||
const oidcWrap = authRow.find('.change-email-oidc-wrap').show();
|
||||
oidcWrap.find('.change-email-oidc-flow-notice').text(
|
||||
i18n('revalidate_flow_notice') ||
|
||||
'You will be asked to sign in with your linked account when you continue.',
|
||||
);
|
||||
// OIDC: no notice box; user will see revalidation when they continue
|
||||
} else {
|
||||
authRow.find('.change-email-oidc-wrap').hide();
|
||||
}
|
||||
@@ -126,7 +122,6 @@ async function UIWindowChangeEmail (options) {
|
||||
} finally {
|
||||
hint.hide();
|
||||
}
|
||||
$(el_window).find('.change-email-revalidated-msg').text(i18n('revalidated') || 'Re-validated.').show();
|
||||
};
|
||||
|
||||
$(el_window).find('.change-email-btn').on('click', async function (e) {
|
||||
|
||||
@@ -40,7 +40,7 @@ async function UIWindowDisable2FA (options) {
|
||||
h += '<div style="overflow: hidden; margin-top: 10px; margin-bottom: 20px;">';
|
||||
h += `<p style="margin:0;font-size:14px;color:#333;">${i18n('disable_2fa_instructions')}</p>`;
|
||||
h += '</div>';
|
||||
h += '<div class="disable-2fa-auth-row" style="display: none; overflow: hidden; margin-top: 10px; margin-bottom: 30px;">';
|
||||
h += '<div class="disable-2fa-auth-row" style="overflow: hidden; margin-top: 10px; margin-bottom: 30px;">';
|
||||
h += '<div class="disable-2fa-password-wrap">';
|
||||
h += `<label>${i18n('account_password')}</label>`;
|
||||
h += `${place_password_entry.html}`;
|
||||
@@ -87,11 +87,7 @@ async function UIWindowDisable2FA (options) {
|
||||
const authRow = $(this_window).find('.disable-2fa-auth-row');
|
||||
if ( oidc_only ) {
|
||||
authRow.find('.disable-2fa-password-wrap').hide();
|
||||
const oidcWrap = authRow.find('.disable-2fa-oidc-wrap').show();
|
||||
oidcWrap.find('.disable-2fa-oidc-flow-notice').text(
|
||||
i18n('revalidate_flow_notice') ||
|
||||
'You will be asked to sign in with your linked account when you continue.',
|
||||
);
|
||||
// OIDC: no notice box; user will see revalidation when they continue
|
||||
} else {
|
||||
authRow.find('.disable-2fa-oidc-wrap').hide();
|
||||
}
|
||||
@@ -127,7 +123,6 @@ async function UIWindowDisable2FA (options) {
|
||||
} finally {
|
||||
hint.hide();
|
||||
}
|
||||
$(el_window).find('.disable-2fa-revalidated-msg').text(i18n('revalidated') || 'Re-validated.').show();
|
||||
};
|
||||
|
||||
$(el_window).find('.disable-2fa-btn').on('click', async function (e) {
|
||||
|
||||
@@ -32,7 +32,7 @@ async function UIWindowChangePassword (options) {
|
||||
// success msg
|
||||
h += '<div class="form-success-msg"></div>';
|
||||
// current password / OIDC revalidate
|
||||
h += '<div class="change-password-auth-row" style="display: none; overflow: hidden; margin-bottom: 20px;">';
|
||||
h += '<div class="change-password-auth-row" style="overflow: hidden; margin-bottom: 20px;">';
|
||||
h += '<div class="change-password-current-wrap">';
|
||||
h += `<label for="current-password-${internal_id}">${i18n('current_password')}</label>`;
|
||||
h += `<input id="current-password-${internal_id}" class="current-password" type="password" name="current-password" autocomplete="current-password" />`;
|
||||
@@ -85,11 +85,7 @@ async function UIWindowChangePassword (options) {
|
||||
const authRow = $(this_window).find('.change-password-auth-row');
|
||||
if ( oidc_only ) {
|
||||
authRow.find('.change-password-current-wrap').hide();
|
||||
const oidcWrap = authRow.find('.change-password-oidc-wrap').show();
|
||||
oidcWrap.find('.change-password-oidc-flow-notice').text(
|
||||
i18n('revalidate_flow_notice') ||
|
||||
'You will be asked to sign in with your linked account when you continue.',
|
||||
);
|
||||
// OIDC: no notice box; user will see revalidation when they continue
|
||||
} else {
|
||||
authRow.find('.change-password-oidc-wrap').hide();
|
||||
}
|
||||
@@ -123,7 +119,6 @@ async function UIWindowChangePassword (options) {
|
||||
} finally {
|
||||
hint.hide();
|
||||
}
|
||||
$(el_window).find('.change-password-revalidated-msg').text(i18n('revalidated') || 'Re-validated.').show();
|
||||
};
|
||||
|
||||
$(el_window).find('.change-password-btn').on('click', async function (e) {
|
||||
|
||||
@@ -33,9 +33,9 @@ async function UIWindowChangeUsername (options) {
|
||||
h += `<label for="confirm-new-username-${internal_id}">${i18n('new_username')}</label>`;
|
||||
h += `<input id="confirm-new-username-${internal_id}" type="text" name="new-username" class="new-username" autocomplete="off" />`;
|
||||
h += '</div>';
|
||||
h += '<div class="change-username-auth-row" style="display: none; overflow: hidden; margin-top: 10px; margin-bottom: 30px;">';
|
||||
h += `<label for="change-username-password-${internal_id}">${i18n('account_password')}</label>`;
|
||||
h += '<div class="change-username-auth-row" style="overflow: hidden; margin-top: 10px; margin-bottom: 30px;">';
|
||||
h += '<div class="change-username-password-wrap">';
|
||||
h += `<label for="change-username-password-${internal_id}">${i18n('account_password')}</label>`;
|
||||
h += `<input id="change-username-password-${internal_id}" type="password" name="password" class="change-username-password" autocomplete="current-password" placeholder="" />`;
|
||||
h += '</div>';
|
||||
h += '<div class="change-username-oidc-wrap" style="display:none;">';
|
||||
@@ -74,11 +74,7 @@ async function UIWindowChangeUsername (options) {
|
||||
const authRow = $(this_window).find('.change-username-auth-row');
|
||||
if ( oidc_only ) {
|
||||
authRow.find('.change-username-password-wrap').hide();
|
||||
const oidcWrap = authRow.find('.change-username-oidc-wrap').show();
|
||||
oidcWrap.find('.change-username-oidc-flow-notice').text(
|
||||
i18n('revalidate_flow_notice') ||
|
||||
'You will be asked to sign in with your linked account when you continue.',
|
||||
);
|
||||
// OIDC: no notice box; user will see revalidation when they continue
|
||||
} else {
|
||||
authRow.find('.change-username-oidc-wrap').hide();
|
||||
}
|
||||
@@ -112,7 +108,6 @@ async function UIWindowChangeUsername (options) {
|
||||
} finally {
|
||||
hint.hide();
|
||||
}
|
||||
$(el_window).find('.change-username-revalidated-msg').text(i18n('revalidated') || 'Re-validated.').show();
|
||||
};
|
||||
|
||||
$(el_window).find('.change-username-btn').on('click', async function (e) {
|
||||
|
||||
Reference in New Issue
Block a user