Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: WebAuthn depends on specific User model name #11594

Closed
1 task done
antonmoiseev opened this issue Sep 20, 2024 · 3 comments · Fixed by #11605
Closed
1 task done

[Bug?]: WebAuthn depends on specific User model name #11594

antonmoiseev opened this issue Sep 20, 2024 · 3 comments · Fixed by #11605
Assignees
Labels
bug/needs-info More information is needed for reproduction topic/auth

Comments

@antonmoiseev
Copy link
Contributor

What's not working?

DbAuthHandler allows overriding names for auth and credential fields. However DbAuthHandler doesn't respect overridden name for the User model in webAuthnAuthenticate() method here. This breaks WebAuthn login flow if User model is renamed.

How do we reproduce the bug?

  1. Generate new Redwood app
  2. Setup dbAuth authentication with WebAuthn support.
  3. Rename User model and UserCredential models to Account and AccountCredential respectively.
  4. Attempt to go through WebAuthn login flow. It fails on the login step with the following error:
    {
      "error": "this.dbCredentialAccessor.findFirst(...).user is not a function"
    }

What's your environment? (If it applies)

System:
  OS: macOS 14.5
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 20.17.0 - /private/var/folders/fn/l_969nyj4bb2j2qcn8qsw2fw0000gn/T/xfs-1224282a/node
  Yarn: 4.4.1 - /private/var/folders/fn/l_969nyj4bb2j2qcn8qsw2fw0000gn/T/xfs-1224282a/yarn
Databases:
  SQLite: 3.43.2 - /usr/bin/sqlite3
Browsers:
  Safari: 17.5
npmPackages:
  @redwoodjs/core: 8.1.1 => 8.1.1
  @redwoodjs/project-config: 8.1.1 => 8.1.1
  @redwoodjs/realtime: 8.1.1 => 8.1.1
  @redwoodjs/studio: 12 => 12.0.0

Are you interested in working on this?

  • I'm interested in working on this
@antonmoiseev antonmoiseev added the bug/needs-info More information is needed for reproduction label Sep 20, 2024
@antonmoiseev
Copy link
Contributor Author

antonmoiseev commented Sep 20, 2024

I reported a similar issue before, that one was fixed 🙏, but WebAuthn still doesn't work.

@Josh-Walker-GM
Copy link
Collaborator

Hahah @antonmoiseev Yeah I just read this issue and thought "hmm this sounds familiar"! Do you want to make a PR for this fix? Would be awesome if you had the capacity!

@antonmoiseev
Copy link
Contributor Author

antonmoiseev commented Sep 24, 2024

@Josh-Walker-GM here is the PR - #11605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction topic/auth
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants