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: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
- Create user
- add API with API docs
- Notifications infrastructure
- Anonymous feedback claiming
- Create widgets for users to embed on their website
4 changes: 4 additions & 0 deletions pages/dashboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ export default {
try {
this.isLoading = true

// Merge any anonymous feedback/votes into the authenticated account.
// This covers the OAuth redirect flow where login/signup pages aren't involved.
$fetch('/api/auth/merge-anonymous', { method: 'POST' }).catch(() => {})

const [sessionResult, orgsResult] = await Promise.all([
authClient.useSession(useFetch),
authClient.organization.list().catch(() => ({ data: [] })),
Expand Down
1 change: 1 addition & 0 deletions pages/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export default {
if (result.error) {
this.error = result.error.message || 'Sign in failed'
} else {
$fetch('/api/auth/merge-anonymous', { method: 'POST' }).catch(() => {})
const redirect = this.$route.query.redirect
await navigateTo(redirect && typeof redirect === 'string' && redirect.startsWith('/') ? redirect : '/dashboard')
}
Expand Down
1 change: 1 addition & 0 deletions pages/signup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export default {
if (result.error) {
this.error = result.error.message || 'Sign up failed'
} else {
$fetch('/api/auth/merge-anonymous', { method: 'POST' }).catch(() => {})
const redirect = this.$route.query.redirect
await navigateTo(redirect && typeof redirect === 'string' && redirect.startsWith('/') ? redirect : '/dashboard')
}
Expand Down
Loading