release: v1.2.1 — login captcha, docs site, and bug fixes

Add slider captcha for web login, VitePress documentation on GitHub Pages,
and fixes for gallery delete refresh, pagination jump, and copy-format persistence.
This commit is contained in:
O96u committed 2026-08-29 11:42:18 +08:00
1 parent 469d3be735
commit ff20f97522
66 files changed
+2497 -616

No files matched your search

+12 -2
View File
@@ -66,6 +66,11 @@ export function getFetchErrorMessage(error: unknown, fallback: string): string {
export type AuthActionResult = { ok: true } | { ok: false, error: string }
export interface LoginCaptchaPayload {
captchaId: string
captchaPosition: number
}
export function useAuth() {
const { t } = useI18n()
const status = useState<AuthStatus>('auth-status', () => 'checking')
@@ -117,7 +122,8 @@ export function useAuth() {
async function login(
credentials: { username: string, password: string }
| { secret: string }
| { secret: string },
captcha: LoginCaptchaPayload
): Promise<{ ok: boolean, needsMigration?: boolean, error?: string }> {
try {
const result = await $fetch<{
@@ -127,7 +133,11 @@ export function useAuth() {
}>('/api/auth/login', {
method: 'POST',
credentials: 'include',
body: credentials
body: {
...credentials,
captchaId: captcha.captchaId,
captchaPosition: captcha.captchaPosition
}
})
if (result.needsMigration) {
return { ok: true, needsMigration: true }
+4
View File
@@ -65,6 +65,10 @@ export function useUploadPreferences() {
loaded.value = true
}
if (import.meta.client && !loaded.value) {
loadPreferences()
}
function savePreferences() {
writeStored({
compressEnabled: compressEnabled.value,