feat(ui): logout page

This commit is contained in:
ArneBo 2024-12-30 11:52:48 +01:00 committed by upsiflu
parent 61e03ca9a0
commit 726f73f177
1 changed files with 32 additions and 30 deletions

View File

@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'
import { useStore } from '~/store' import { useStore } from '~/store'
import Button from '~/components/ui/Button.vue' import Button from '~/components/ui/Button.vue'
import Spacer from '~/components/ui/layout/Spacer.vue'
const store = useStore() const store = useStore()
const { t } = useI18n() const { t } = useI18n()
@ -18,37 +19,38 @@ const labels = computed(() => ({
v-title="labels.title" v-title="labels.title"
class="main" class="main"
> >
<section class="ui vertical stripe segment"> <div
<div v-if="store.state.auth.authenticated"
v-if="store.state.auth.authenticated" class="ui small text container"
class="ui small text container" >
<h2>
{{ t('components.auth.Logout.header.confirm') }}
</h2>
<p>
{{ t('components.auth.Logout.message.loggedIn', { username: store.state.auth.username }) }}
</p>
<Spacer />
<Button
solid
primary
@click="store.dispatch('auth/logout')"
> >
<h2> {{ t('components.auth.Logout.button.logout') }}
{{ t('components.auth.Logout.header.confirm') }} </Button>
</h2> </div>
<p> <div
{{ t('components.auth.Logout.message.loggedIn', { username: store.state.auth.username }) }} v-else
</p> class="ui small text container"
<Button >
@click="store.dispatch('auth/logout')" <h2>
> {{ t('components.auth.Logout.header.unauthenticated') }}
{{ t('components.auth.Logout.button.logout') }} </h2>
</Button> <router-link
</div> to="/login"
<div class="ui button"
v-else
class="ui small text container"
> >
<h2> {{ t('components.auth.Logout.link.login') }}
{{ t('components.auth.Logout.header.unauthenticated') }} </router-link>
</h2> </div>
<router-link
to="/login"
class="ui button"
>
{{ t('components.auth.Logout.link.login') }}
</router-link>
</div>
</section>
</main> </main>
</template> </template>