feat(ui): language persistence, theme fix, font/size settings, header quick-access
Some checks failed
CI / UI (push) Failing after 54s
CI / Backend (push) Successful in 1m56s
Release / Test backend (push) Successful in 41s
Release / Check ui (push) Successful in 50s
Release / Docker / caddy (push) Successful in 54s
CI / Backend (pull_request) Successful in 45s
CI / UI (pull_request) Successful in 50s
Release / Docker / ui (push) Successful in 2m23s
Release / Docker / runner (push) Successful in 3m15s
Release / Docker / backend (push) Successful in 2m3s
Release / Gitea Release (push) Failing after 2s
Some checks failed
CI / UI (push) Failing after 54s
CI / Backend (push) Successful in 1m56s
Release / Test backend (push) Successful in 41s
Release / Check ui (push) Successful in 50s
Release / Docker / caddy (push) Successful in 54s
CI / Backend (pull_request) Successful in 45s
CI / UI (pull_request) Successful in 50s
Release / Docker / ui (push) Successful in 2m23s
Release / Docker / runner (push) Successful in 3m15s
Release / Docker / backend (push) Successful in 2m3s
Release / Gitea Release (push) Failing after 2s
- Fix language not persisting after refresh: save locale in user_settings, set PARAGLIDE_LOCALE cookie from DB preference on server load - Fix theme change not applying: context setter was mismatched (setTheme vs current) - Add font family (system/serif/mono) and text size (sm/md/lg/xl) user settings stored in DB and applied via CSS custom properties - Add theme color dots and language picker to desktop header for quick access - Footer locale switcher now saves preference to DB before switching - Remove change password section (OAuth-only, no password login) - Fix active sessions piling up: reuse existing session on re-login via OAuth - Extend speed step cycle to include 2.5× and 3.0× (matching profile slider) - Replace plain checkbox with modern toggle switch for auto-next setting - Fix catalogue status labels (ongoing/completed) to use translation keys - Add font family and text size translation keys to all 5 locale files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { fail, redirect } from '@sveltejs/kit';
|
||||
import type { Actions, PageServerLoad } from './$types';
|
||||
import { changePassword, listUserSessions, getUserByUsername } from '$lib/server/pocketbase';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
import { listUserSessions, getUserByUsername } from '$lib/server/pocketbase';
|
||||
import { resolveAvatarUrl } from '$lib/server/minio';
|
||||
import { log } from '$lib/server/logger';
|
||||
|
||||
@@ -38,40 +38,3 @@ export const load: PageServerLoad = async ({ locals }) => {
|
||||
}))
|
||||
};
|
||||
};
|
||||
|
||||
export const actions: Actions = {
|
||||
changePassword: async ({ request, locals }) => {
|
||||
if (!locals.user) {
|
||||
return fail(401, { error: 'Not logged in.' });
|
||||
}
|
||||
|
||||
const data = await request.formData();
|
||||
const current = (data.get('current') as string | null) ?? '';
|
||||
const next = (data.get('next') as string | null) ?? '';
|
||||
const confirm = (data.get('confirm') as string | null) ?? '';
|
||||
|
||||
if (!current || !next || !confirm) {
|
||||
return fail(400, { error: 'All fields are required.' });
|
||||
}
|
||||
if (next.length < 8) {
|
||||
return fail(400, { error: 'New password must be at least 8 characters.' });
|
||||
}
|
||||
if (next !== confirm) {
|
||||
return fail(400, { error: 'New passwords do not match.' });
|
||||
}
|
||||
|
||||
let ok: boolean;
|
||||
try {
|
||||
ok = await changePassword(locals.user.id, current, next);
|
||||
} catch (e) {
|
||||
log.error('profile', 'changePassword failed', { err: String(e) });
|
||||
return fail(500, { error: 'An error occurred. Please try again.' });
|
||||
}
|
||||
|
||||
if (!ok) {
|
||||
return fail(401, { error: 'Current password is incorrect.' });
|
||||
}
|
||||
|
||||
return { success: true };
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user