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?]: dbAuth userAttributes
comment error
#10456
Comments
@pantheredeye I'm meeting with @dthyresson later today, I'll ask him about the |
@pantheredeye The redwood/packages/auth-providers/dbAuth/setup/src/templates/api/functions/auth.ts.template Line 132 in 852e457
The templates sets it as In you case, just change the argument to be without the underscore and then in the user create data refer to the variable as |
That all makes sense and is easy enough. I was really hoping that we could make a note of sorts to inform the user how to handle this by either adding the |
How do we close this? I do feel like this will trip someone else up, so I would like to have a note in the docs explaining this. If that is a no vote, then we can just close this issue, correct? |
If anything I’d update the template to:
I do think the ide and typescript give rather informative messaging to let the developer implement correctly |
What's not working?
After setting up dbAuth, the signupOptions code in
api\src\functions\auth.js
has an example user attribute that is commented out. Well, I needed that exact field, so I uncommented it and ran into an error on the next signup attempt. I ended up adding an underscore to match the props in the handler, changing it fromname: userAttributes.name
toname: _userAttributes.name
and sign up worked.I am not sure what the _ indicates, but it is in the params for the handler, so I am guessing it should be included the commented out line?
This search: https://github.com/search?q=repo%3Aredwoodjs%2Fredwood%20userAttributes.name&type=code has quite a few files show up... if its a matter of going through most of these and adding _, could we label this "Good first Issue?"
Generated Code:
Working code with accompanying paragraph at the top:
The text was updated successfully, but these errors were encountered: