improve recent logout information

This commit is contained in:
kritzl 2026-05-11 20:55:58 +02:00
commit bcfcf264f6
Signed by: kritzl
SSH key fingerprint: SHA256:5BmINP9VjZWaUk5Z+2CTut1KFhwLtd0ZynMekKbtViM
3 changed files with 22 additions and 13 deletions

View file

@ -89,7 +89,8 @@ const t = useTranslations(lang)
const error = e.getActualType()
if (error.status === 401) {
auth.recentLogout = auth.authenticated // set recentLogout true, if user was logged in before
if (!auth.recentLogout)
auth.recentLogout = auth.authenticated // set recentLogout true, if user was logged in before
auth.authenticated = false
auth.authorized = false
auth.until = null
@ -237,6 +238,20 @@ const t = useTranslations(lang)
</script>
</Fragment>
<div class="grid place-items-center grid-cols-1 gap-4 max-w-xl mx-auto" id="list">
<Alert
classList="hidden"
id="alert-loggedout"
color="warning"
title={t("loggedOut.title")}
description={t("loggedOut.description")}
>
<div class="flex justify-end">
<a href="/auth/login" class="btn btn-sm btn-warning">
<LogIn/>
{t("login")}
</a>
</div>
</Alert>
<Alert
classList="hidden"
id="alert-unauthenticated"
@ -259,13 +274,6 @@ const t = useTranslations(lang)
<Lock class="size-7"/>
</Fragment>
</Alert>
<Alert
classList="hidden"
id="alert-loggedout"
color="warning"
title={t("loggedOut.title")}
description={t("loggedOut.description")}
/>
<Alert
classList="hidden"
id="alert-serverError"