Skip to content

Broken Trino impersonation #371

Closed
Closed

Description

@Bohreromir

In #330 I set input: false on user.additionalFields.username to stop users from changing it through /api/auth/update-user.
But better-auth also applies input: false to the OAuth provider profile: parseAdditionalUserInputFromProviderProfile skips such fields, so the username returned by mapProfileToUser is dropped when the user is created.

Without a username, the Trino API routes fall back to locals.user?.username ?? 'anonymous', which hides the error and breaks impersonation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions