Skip to content

Commit ccfa7a2

Browse files
committed
Revert "feat(session-management): implement session expiration handling and UI feedback for demo accounts"
This reverts commit 3a6c1f4.
1 parent 24ec4ca commit ccfa7a2

4 files changed

Lines changed: 2 additions & 115 deletions

File tree

app/composables/useSessionGuard.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

app/layouts/dashboard.vue

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
<script setup lang="ts">
2-
import { Eye, LogIn } from 'lucide-vue-next'
2+
import { Eye } from 'lucide-vue-next'
33
import { usePreviewReadOnly } from '~/composables/usePreviewReadOnly'
44
55
const { data: session } = await authClient.useSession(useFetch)
66
77
const config = useRuntimeConfig()
8-
const localePath = useLocalePath()
98
const { activeOrg } = useCurrentOrg()
109
const { isUpsellOpen, closeUpsell } = usePreviewReadOnly()
11-
const { sessionExpired } = useSessionGuard()
1210
1311
const isDemo = computed(() => {
1412
const slug = config.public.demoOrgSlug
1513
return slug && activeOrg.value?.slug === slug
1614
})
1715
1816
const isDemoAccount = computed(() => session.value?.user?.email === 'demo@reqcore.com')
19-
20-
function handleSignInAgain() {
21-
navigateTo(localePath('/auth/sign-in?session=expired'))
22-
}
2317
</script>
2418

2519
<template>
@@ -30,33 +24,6 @@ function handleSignInAgain() {
3024
<ClientOnly>
3125
<DemoUpsellBanner v-if="isDemoAccount" />
3226
</ClientOnly>
33-
34-
<!-- Session expired overlay (shown after demo reseed or session invalidation) -->
35-
<ClientOnly>
36-
<Teleport to="body">
37-
<div
38-
v-if="sessionExpired"
39-
class="fixed inset-0 z-[100] flex items-center justify-center bg-surface-950/60 backdrop-blur-sm"
40-
>
41-
<div class="mx-4 max-w-md rounded-2xl border border-surface-200 dark:border-surface-800 bg-white dark:bg-surface-900 p-8 text-center shadow-xl">
42-
<LogIn class="mx-auto mb-4 size-10 text-brand-500" />
43-
<h2 class="text-lg font-semibold text-surface-900 dark:text-surface-100 mb-2">
44-
Session expired
45-
</h2>
46-
<p class="text-sm text-surface-500 dark:text-surface-400 mb-6 leading-relaxed">
47-
The demo account was recently updated with fresh data. Please sign in again to continue exploring.
48-
</p>
49-
<button
50-
class="inline-flex items-center gap-2 rounded-lg bg-brand-600 px-5 py-2.5 text-sm font-medium text-white hover:bg-brand-700 transition-colors cursor-pointer"
51-
@click="handleSignInAgain"
52-
>
53-
Sign in again
54-
</button>
55-
</div>
56-
</div>
57-
</Teleport>
58-
</ClientOnly>
59-
6027
<main class="relative flex-1 min-h-0 overflow-y-auto px-4 py-6 sm:px-6 lg:px-8 lg:py-8">
6128
<!-- Demo mode banner -->
6229
<div

app/layouts/settings.vue

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
<script setup lang="ts">
2-
import { Eye, LogIn } from 'lucide-vue-next'
2+
import { Eye } from 'lucide-vue-next'
33
import { usePreviewReadOnly } from '~/composables/usePreviewReadOnly'
44
55
const { data: session } = await authClient.useSession(useFetch)
66
77
const config = useRuntimeConfig()
8-
const localePath = useLocalePath()
98
const { activeOrg } = useCurrentOrg()
109
const { isUpsellOpen, closeUpsell } = usePreviewReadOnly()
11-
const { sessionExpired } = useSessionGuard()
1210
1311
const isDemo = computed(() => {
1412
const slug = config.public.demoOrgSlug
1513
return slug && activeOrg.value?.slug === slug
1614
})
1715
1816
const isDemoAccount = computed(() => session.value?.user?.email === 'demo@reqcore.com')
19-
20-
function handleSignInAgain() {
21-
navigateTo(localePath('/auth/sign-in?session=expired'))
22-
}
2317
</script>
2418

2519
<template>
@@ -32,32 +26,6 @@ function handleSignInAgain() {
3226
<DemoUpsellBanner v-if="isDemoAccount" />
3327
</ClientOnly>
3428

35-
<!-- Session expired overlay (shown after demo reseed or session invalidation) -->
36-
<ClientOnly>
37-
<Teleport to="body">
38-
<div
39-
v-if="sessionExpired"
40-
class="fixed inset-0 z-[100] flex items-center justify-center bg-surface-950/60 backdrop-blur-sm"
41-
>
42-
<div class="mx-4 max-w-md rounded-2xl border border-surface-200 dark:border-surface-800 bg-white dark:bg-surface-900 p-8 text-center shadow-xl">
43-
<LogIn class="mx-auto mb-4 size-10 text-brand-500" />
44-
<h2 class="text-lg font-semibold text-surface-900 dark:text-surface-100 mb-2">
45-
Session expired
46-
</h2>
47-
<p class="text-sm text-surface-500 dark:text-surface-400 mb-6 leading-relaxed">
48-
The demo account was recently updated with fresh data. Please sign in again to continue exploring.
49-
</p>
50-
<button
51-
class="inline-flex items-center gap-2 rounded-lg bg-brand-600 px-5 py-2.5 text-sm font-medium text-white hover:bg-brand-700 transition-colors cursor-pointer"
52-
@click="handleSignInAgain"
53-
>
54-
Sign in again
55-
</button>
56-
</div>
57-
</div>
58-
</Teleport>
59-
</ClientOnly>
60-
6129
<!-- Demo mode banner -->
6230
<div
6331
v-if="isDemo"

app/pages/auth/sign-in.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ if (route.query.live === '1') {
2626
password.value = config.public.liveDemoSecret
2727
}
2828
29-
const isSessionExpired = computed(() => route.query.session === 'expired')
30-
3129
async function handleSignIn() {
3230
error.value = ''
3331
@@ -75,10 +73,6 @@ async function handleSignIn() {
7573
<form class="flex flex-col gap-4" @submit.prevent="handleSignIn">
7674
<h2 class="text-xl font-semibold text-center text-surface-900 dark:text-surface-100 mb-2">Sign in to your account</h2>
7775

78-
<div v-if="isSessionExpired" class="rounded-md border border-brand-200 dark:border-brand-800 bg-brand-50 dark:bg-brand-950 p-3 text-sm text-brand-700 dark:text-brand-400">
79-
The demo account was recently updated with fresh data. Please sign in again to continue exploring.
80-
</div>
81-
8276
<div v-if="error" class="rounded-md border border-danger-200 dark:border-danger-800 bg-danger-50 dark:bg-danger-950 p-3 text-sm text-danger-700 dark:text-danger-400">{{ error }}</div>
8377

8478
<label class="flex flex-col gap-1 text-sm font-medium text-surface-700 dark:text-surface-300">

0 commit comments

Comments
 (0)