Add support for message history pagination, preserve scroll in rendering, and improve draft/message workflows.
CI / check (22) (push) Successful in 9m34s
CI / check (24) (push) Successful in 9m34s

This commit is contained in:
2026-10-06 00:32:18 +02:00
parent 1c0f06716e
commit 387c0ac2e7
40 changed files with 2374 additions and 1314 deletions
+3
View File
@@ -6,6 +6,7 @@ import {asyncHandler} from "../middleware/asyncHandler.js";
import bcrypt from "bcrypt";
import {requireLogin} from "../middleware/auth.js";
import {validateBody} from "../middleware/validate.js";
import {newPasswordError} from "../services/passwordPolicy.js";
const usernameValidator = (body) => {
const username = String(body?.username || "").trim();
@@ -72,6 +73,8 @@ export function createSettingsRouter({repositories}) {
router.put("/settings/password", validateBody(passwordValidator), asyncHandler(async (req, res) => {
const username = req.session.user;
const {currentPassword, newPassword} = req.validatedBody;
const passwordError = newPasswordError(newPassword);
if (passwordError) return res.status(400).json({error: passwordError, code: "PASSWORD_TOO_LONG"});
const user = repositories.getUser(username);
if (!user) return res.status(404).json({error: "User not found"});
const valid = await bcrypt.compare(currentPassword, user.password);