Changing the password: the Logout button at the far right of the toolbar became an Account menu that names the signed-in account in an entry of its own that cannot be picked, with Change password... above Logout, and the new dialog (src/editor/auth/PasswordDialog.ts) asks for the current password, the new one and its repetition, all three as bullets, and stays standing when the server refuses so that it can say why, unlike the other form dialogs; the rules for empty, too short, new equal to old and a differing repetition sit as the pure function passwordProblem() next to loginProblem(), the API gained POST ?r=auth/password which answers 204, insists on the current password although a session is there, enforces a minimum length of 8 in UserStore::MIN_PASSWORD_LENGTH and again in the client so the mask can answer without asking the server, and the new SessionStore::destroyAllFor($user, $keep) ends every other session of the account while the tab that changed the password keeps its own; the placeholders admin/admin and user/user stay as they are, which the length check does not touch because it only runs when a password is set through the API; e2e 45 grew by 8 checks for the menu, the dialog, both refusals and signing in with the old and the new password, and it sets the e2e account back at the end - a run dying in between leaves it on <password>-tmp, which a make-user.php call repairs (#182)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ef497fa17
commit
c830c7a3aa
15 files changed
+473
-18
No files matched your search
@@ -14,8 +14,8 @@ export interface ToolbarActions {
|
||||
togglePlay(): void;
|
||||
/** Hold or resume the running world; only reachable in play mode. */
|
||||
togglePause(): void;
|
||||
/** Ends the session and returns to the sign-in screen. */
|
||||
logOut(): void;
|
||||
/** The account menu at the far right: who is signed in, changing the password, signing out. */
|
||||
openAccountMenu(anchor: Widget): void;
|
||||
}
|
||||
|
||||
const SAVE_LABELS: Record<SaveStatus, string> = {
|
||||
@@ -94,7 +94,7 @@ export class Toolbar extends HStack {
|
||||
this.add(this.pauseButton);
|
||||
this.add(new Spacer(), 1);
|
||||
|
||||
// Flexible, not a fixed strip: it is the one thing here that may shrink, and since the Logout
|
||||
// Flexible, not a fixed strip: it is the one thing here that may shrink, and since the account
|
||||
// button (#177) the row no longer fits a narrow window otherwise.
|
||||
this.notice = new Label('', { style: 'small', align: 'right' });
|
||||
this.add(this.notice, 1);
|
||||
@@ -104,8 +104,10 @@ export class Toolbar extends HStack {
|
||||
this.fps = new Label('– fps', { style: 'small', align: 'right' });
|
||||
this.fps.minWidth = 56;
|
||||
this.add(this.fps);
|
||||
// Far right, where the account lives; who is signed in stands in the window title.
|
||||
this.add(new Button('Logout', { onClick: () => actions.logOut() }));
|
||||
// Far right, where the account lives. A menu rather than a Logout button (#182): it holds
|
||||
// everything about the account without asking the row for more width, which it has none of.
|
||||
const account = new Dropdown('Account', { onClick: () => actions.openAccountMenu(account) });
|
||||
this.add(account);
|
||||
|
||||
state.on('project', () => this.refresh());
|
||||
state.on('load', () => this.refresh());
|
||||
|
||||
Reference in new issue
Block a user