Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/components/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const userEmail = computed(() => session.value?.user?.email ?? '')
async function handleSignOut() {
isSigningOut.value = true
await authClient.signOut()
clearNuxtData()
await navigateTo('/auth/sign-in')
}
Comment on lines 18 to 23
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Guard sign-out flow with try/finally to prevent a stuck disabled button.

If Line 20, Line 21, or Line 22 throws, isSigningOut never resets and the action remains disabled.

💡 Proposed fix
 async function handleSignOut() {
   isSigningOut.value = true
-  await authClient.signOut()
-  clearNuxtData()
-  await navigateTo('/auth/sign-in')
+  try {
+    await authClient.signOut()
+    clearNuxtData()
+    await navigateTo('/auth/sign-in')
+  } finally {
+    isSigningOut.value = false
+  }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async function handleSignOut() {
isSigningOut.value = true
await authClient.signOut()
clearNuxtData()
await navigateTo('/auth/sign-in')
}
async function handleSignOut() {
isSigningOut.value = true
try {
await authClient.signOut()
clearNuxtData()
await navigateTo('/auth/sign-in')
} finally {
isSigningOut.value = false
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/AppSidebar.vue` around lines 18 - 23, The sign-out flow in
handleSignOut sets isSigningOut.value = true but doesn't reset it if
authClient.signOut(), clearNuxtData(), or navigateTo('/auth/sign-in') throws;
wrap the main logic in a try/finally so isSigningOut.value is reset in the
finally block (optionally catch/log errors from
authClient.signOut/clearNuxtData/navigateTo before rethrowing) to ensure the
disabled state never gets stuck.


Expand Down
1 change: 1 addition & 0 deletions app/pages/auth/sign-in.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async function handleSignIn() {
return
}

clearNuxtData()
await navigateTo('/dashboard')
}
</script>
Expand Down
1 change: 1 addition & 0 deletions app/pages/auth/sign-up.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ async function handleSignUp() {
return
}

clearNuxtData()
await navigateTo('/onboarding/create-org')
}
</script>
Expand Down