-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Expand file tree
/
Copy pathindex.vue
More file actions
31 lines (30 loc) · 1.07 KB
/
Copy pathindex.vue
File metadata and controls
31 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<script setup lang="ts">
const { data: oidcConfig, status } = useFetch<{ enabled: boolean }>('/api/auth/config')
const loginMode = computed(() => resolveLoginMode(status.value, oidcConfig.value?.enabled))
</script>
<template>
<Card class="w-full max-w-sm">
<CardHeader>
<CardTitle>
<h1 class="text-2xl font-medium text-balance">
{{ $t('login.title') }}
</h1>
</CardTitle>
<CardDescription v-if="loginMode === 'single-user'">
{{ $t('login.description') }}
</CardDescription>
</CardHeader>
<CardContent class="grid gap-4">
<Skeleton v-if="loginMode === 'loading'" class="h-9 w-full" />
<template v-else-if="loginMode === 'oidc'">
<Button type="button" class="w-full" @click="signInWithOidc()">
{{ $t('login.oidc_submit') }}
</Button>
</template>
<LoginForm v-else-if="loginMode === 'single-user'" />
<Alert v-else variant="destructive" role="alert">
<AlertTitle>{{ $t('login.failed') }}</AlertTitle>
</Alert>
</CardContent>
</Card>
</template>