Skip to content

Duplicate users tables with different ids? #30

@MarkLyck

Description

@MarkLyck

I'm investigating migrating an app from Supabase to convex with better-auth.

I got the project working with login/signup and creating an organization. However I feel like I'm missing something?

The BetterAuth tables seems to be in a different sandboxed "component" from the app tables, and I don't see a way to access them. The docs recommend basically creating a duplicate "users" table to store users in the app table. But the ids don't match, and if you try to make them match it throws an error.

This means when you get your user id from better-auth it doesn't match the user in the users table in the app component?

Is it really intentional that when using BetterAuth with Convex you have duplicate tables of users, with different ids, and no way to query the original BetterAuth table from the app?

If that's the expected pattern, how do you map your user from the better-auth session to the user in the DB?

Also for users there's an onCreateUser hook to sync with, but I see no equivalent for organizations and teams? So how are you supposed to effectively manage those without access to the BetterAuth tables?

I'm probably missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions