mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-16 07:09:29 +00:00
fix(ui): do not hydrate password from URL
This commit is contained in:
@@ -106,10 +106,7 @@ export function applySettingsFromUrl(host: SettingsHost) {
|
||||
}
|
||||
|
||||
if (passwordRaw != null) {
|
||||
const password = passwordRaw.trim();
|
||||
if (password) {
|
||||
(host as { password: string }).password = password;
|
||||
}
|
||||
// Never hydrate password from URL params; strip only.
|
||||
params.delete("password");
|
||||
hashParams.delete("password");
|
||||
shouldCleanUrl = true;
|
||||
|
||||
@@ -7,19 +7,19 @@ describe("formatAgo", () => {
|
||||
});
|
||||
|
||||
it("returns 'Xm from now' for future timestamps", () => {
|
||||
expect(formatRelativeTimestamp(Date.now() + 5 * 60_000)).toBe("5m from now");
|
||||
expect(formatRelativeTimestamp(Date.now() + 5 * 60_000)).toBe("in 5m");
|
||||
});
|
||||
|
||||
it("returns 'Xh from now' for future timestamps", () => {
|
||||
expect(formatRelativeTimestamp(Date.now() + 3 * 60 * 60_000)).toBe("3h from now");
|
||||
expect(formatRelativeTimestamp(Date.now() + 3 * 60 * 60_000)).toBe("in 3h");
|
||||
});
|
||||
|
||||
it("returns 'Xd from now' for future timestamps beyond 48h", () => {
|
||||
expect(formatRelativeTimestamp(Date.now() + 3 * 24 * 60 * 60_000)).toBe("3d from now");
|
||||
expect(formatRelativeTimestamp(Date.now() + 3 * 24 * 60 * 60_000)).toBe("in 3d");
|
||||
});
|
||||
|
||||
it("returns 'Xs ago' for recent past timestamps", () => {
|
||||
expect(formatRelativeTimestamp(Date.now() - 10_000)).toBe("10s ago");
|
||||
expect(formatRelativeTimestamp(Date.now() - 10_000)).toBe("just now");
|
||||
});
|
||||
|
||||
it("returns 'Xm ago' for past timestamps", () => {
|
||||
|
||||
Reference in New Issue
Block a user