Skip to content

[Bug]: DbAuthHandler doesn't allow renaming User model #8743

@antonmoiseev

Description

@antonmoiseev

What's not working?

DbAuthHandler explicitly references user() model in a Prisma query which doesn't allow renaming Prisma User model into anything else. This is where it's happening (line 810):
https://github.com/redwoodjs/redwood/blob/2a42df9de2bcb34f368cfc5cbc882967d4a7d3c9/packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts#L806-L810

Instead it should use authModelAccessor to access the table.

How do we reproduce the bug?

  1. Rename the User model
  2. Add a user to the database
  3. Start the app and try to login into it

What's your environment? (If it applies)

System:
    OS: macOS 13.4.1
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.20.1 - /private/var/folders/fn/8llygws922d451wc05087z4r0000gn/T/xfs-b6f22933/node
    Yarn: 3.5.0 - /private/var/folders/fn/8llygws922d451wc05087z4r0000gn/T/xfs-b6f22933/yarn
  Databases:
    SQLite: 3.39.5 - /usr/bin/sqlite3
  Browsers:
    Chrome: 114.0.5735.133
    Safari: 16.5.1
  npmPackages:
    @redwoodjs/auth-dbauth-setup: 5.3.2 => 5.3.2
    @redwoodjs/core: 5.3.2 => 5.3.2

Are you interested in working on this?

  • I'm interested in working on this

Metadata

Metadata

Labels

bug/confirmedWe have confirmed this is a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions