66 <v-progress-circular indeterminate size =" 64" />
77 </div >
88
9- <!-- Authentication Screen -->
10- <Auth v-else-if =" !user" />
11-
12- <!-- Main App (Authenticated) -->
9+ <!-- Main App -->
1310 <v-container v-else class =" pa-0 max-w-md mx-auto" fluid >
14- <!-- Header -->
15- <AppHeader :user =" user" @logout =" handleLogout" @change-password =" showPasswordChange = true" />
11+ <!-- Header (only show if user is authenticated) -->
12+ <AppHeader
13+ v-if =" user"
14+ :user =" user"
15+ @logout =" handleLogout"
16+ @change-password =" showPasswordChange = true"
17+ />
1618
1719 <!-- Main Content Area -->
1820 <div class =" content-area" >
2224 />
2325 </div >
2426
25- <!-- Floating Action Button (only show on home tab) -->
26- <div v-if =" $route.name === 'Home'" class =" fixed-fab" >
27+ <!-- Floating Action Button (only show on home tab and if authenticated ) -->
28+ <div v-if =" user && $route.name === 'Home'" class =" fixed-fab" >
2729 <v-fab
2830 location =" bottom center"
2931 size =" 56"
3335 />
3436 </div >
3537
36- <!-- Bottom Navigation -->
37- <BottomNavigation />
38+ <!-- Bottom Navigation (only show if authenticated) -->
39+ <BottomNavigation v-if = " user " />
3840
39- <!-- Expense Form Dialog -->
41+ <!-- Expense Form Dialog (only show if authenticated) -->
4042 <ExpenseFormManager
43+ v-if =" user"
4144 v-model =" showForm"
4245 :expense =" editingExpense"
4346 />
4447
45- <!-- Password Change Dialog -->
46- <PasswordChange v-model =" showPasswordChange" />
48+ <!-- Password Change Dialog (only show if authenticated) -->
49+ <PasswordChange
50+ v-if =" user"
51+ v-model =" showPasswordChange"
52+ />
4753 </v-container >
4854 </v-main >
4955 </v-app >
5056</template >
5157
5258<script setup lang="ts">
5359import { ref , onMounted } from ' vue'
60+ import { useRouter } from ' vue-router'
5461import { useSupabase } from ' ./composables/useSupabase'
5562import { useExpenseManagement } from ' ./composables/useExpenseManagement'
5663import AppHeader from ' ./components/AppHeader.vue'
57- import Auth from ' ./components/Auth.vue'
5864import ExpenseFormManager from ' ./components/ExpenseFormManager.vue'
5965import BottomNavigation from ' ./components/BottomNavigation.vue'
6066import PasswordChange from ' ./components/PasswordChange.vue'
6167import { type Expense } from ' ./types'
6268
6369const { user, loading, signOut, initAuth } = useSupabase ()
6470const { refreshTrigger } = useExpenseManagement ()
71+ const router = useRouter ()
6572
6673const showForm = ref (false )
6774const showPasswordChange = ref (false )
@@ -74,6 +81,7 @@ onMounted(async () => {
7481
7582const handleLogout = async () => {
7683 await signOut ()
84+ router .push (' /login' )
7785}
7886
7987// Handle editing an expense
0 commit comments