Implemented auth app authentication in API mode (if loading the app itself wasn't blocked). Removed unnecessary toasts when entering restricted pages.

This commit is contained in:
2025-12-02 15:25:31 +00:00
parent d4f8e97469
commit 3030122807
9 changed files with 243 additions and 65 deletions
+5
View File
@@ -173,6 +173,11 @@ const saveName = async () => {
try {
saving.value = true
const res = await fetch('/auth/api/user/display-name', { method: 'PUT', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ display_name: name }) })
if (res.status === 401) {
authStore.authRequired = true
authStore.showMessage('Authentication required', 'error')
return
}
const data = await res.json()
if (!res.ok || data.detail) throw new Error(data.detail || 'Update failed')
showNameDialog.value = false