Skip to content

Commit 5bf215b

Browse files
author
Lasim
committed
fix(frontend): update logout messages for clarity and consistency
1 parent c19c47a commit 5bf215b

File tree

2 files changed

+41
-46
lines changed

2 files changed

+41
-46
lines changed

services/frontend/src/i18n/locales/en/auth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
export default {
33
logout: {
44
title: 'Logout',
5-
inProgressMessage: 'Logout in Progress... Redirecting to login.',
5+
inProgressMessage: 'Logging out...',
6+
successMessage: 'You have been logged out successfully. Redirecting to login...',
67
},
78
}
Lines changed: 39 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,59 @@
1-
<template>
2-
<div class="flex items-center justify-center min-h-screen bg-background">
3-
<Card class="w-full max-w-md p-6">
4-
<CardHeader>
5-
<CardTitle class="text-center text-2xl font-bold">{{ t('logout.title') }}</CardTitle>
6-
</CardHeader>
7-
<CardContent>
8-
<p class="text-center text-muted-foreground">
9-
{{ message }}
10-
</p>
11-
<div class="mt-4 flex justify-center">
12-
<svg v-if="isLoading" class="animate-spin h-8 w-8 text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
13-
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
14-
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
15-
</svg>
16-
</div>
17-
</CardContent>
18-
</Card>
19-
</div>
20-
</template>
21-
221
<script setup lang="ts">
232
import { onMounted, ref } from 'vue'
243
import { useRouter } from 'vue-router'
254
import { useI18n } from 'vue-i18n'
26-
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
5+
import { Card, CardContent } from '@/components/ui/card'
6+
import { Spinner } from '@/components/ui/spinner'
277
import { UserService } from '@/services/userService'
288
299
const router = useRouter()
3010
const { t } = useI18n()
3111
3212
const isLoading = ref(true)
33-
const message = ref(t('logout.inProgressMessage'))
13+
const message = ref('')
3414
3515
onMounted(async () => {
36-
isLoading.value = true;
37-
message.value = t('logout.inProgressMessage');
16+
isLoading.value = true
17+
message.value = t('logout.inProgressMessage')
3818
try {
39-
// Use the UserService logout method which handles cache clearing
40-
await UserService.logout();
41-
message.value = t('logout.successMessage') || t('logout.inProgressMessage');
19+
await UserService.logout()
20+
message.value = t('logout.successMessage')
4221
} catch (error) {
43-
console.error('Error during logout:', error);
44-
message.value = t('common.error');
22+
console.error('Error during logout:', error)
23+
message.value = t('common.error')
4524
} finally {
46-
isLoading.value = false;
25+
isLoading.value = false
4726
setTimeout(() => {
48-
router.push('/login');
49-
}, 2000); // Redirect after 2 seconds to allow user to see final message
27+
router.push('/login')
28+
}, 2000)
5029
}
5130
})
5231
</script>
5332

54-
<style scoped>
55-
/* Add any additional styles if needed */
56-
.bg-background {
57-
background-color: hsl(var(--background));
58-
}
59-
.text-primary {
60-
color: hsl(var(--primary));
61-
}
62-
.text-muted-foreground {
63-
color: hsl(var(--muted-foreground));
64-
}
65-
</style>
33+
<template>
34+
<div class="flex min-h-full flex-1 flex-col justify-center px-6 py-12 lg:px-8">
35+
<div class="sm:mx-auto sm:w-full sm:max-w-sm">
36+
<img
37+
class="mx-auto h-20 w-auto"
38+
src="/deploystack-logo-80x80.png"
39+
alt="DeployStack Logo"
40+
/>
41+
<h2 class="mt-10 text-center text-2xl font-bold tracking-tight text-gray-900">
42+
{{ $t('logout.title') }}
43+
</h2>
44+
</div>
45+
46+
<div class="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
47+
<Card>
48+
<CardContent class="pt-6">
49+
<p class="text-center text-muted-foreground">
50+
{{ message }}
51+
</p>
52+
<div v-if="isLoading" class="mt-4 flex justify-center">
53+
<Spinner class="h-8 w-8" />
54+
</div>
55+
</CardContent>
56+
</Card>
57+
</div>
58+
</div>
59+
</template>

0 commit comments

Comments
 (0)