Skip to content

Commit 13275e9

Browse files
committed
fix(auth): append generateId() suffix to Wealthbox account IDs to match codebase pattern
All other providers use `${stableId}-${generateId()}` so the account.create.after hook can strip the UUID suffix, find stale sibling rows, and migrate credential FKs. Without the suffix the migration logic is skipped and reconnections would hit duplicate key conflicts instead of gracefully updating credentials.
1 parent c90c3f2 commit 13275e9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/sim/lib/auth/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,7 @@ export const auth = betterAuth({
16411641
const name = data.name || data.full_name || data.username || 'Wealthbox User'
16421642

16431643
return {
1644-
id: `wealthbox-${userId}`,
1644+
id: `wealthbox-${userId}-${generateId()}`,
16451645
name,
16461646
email,
16471647
emailVerified: false,
@@ -1666,7 +1666,7 @@ export const auth = betterAuth({
16661666
}
16671667
const tokenHash = createHash('sha256').update(stableToken).digest('hex').slice(0, 24)
16681668
return {
1669-
id: `wealthbox-${tokenHash}`,
1669+
id: `wealthbox-${tokenHash}-${generateId()}`,
16701670
name: 'Wealthbox User',
16711671
email: `wealthbox-${tokenHash}@wealthbox.user`,
16721672
emailVerified: false,

0 commit comments

Comments
 (0)