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

Unable to register new user #1

Closed
ASoldo opened this issue Jul 21, 2022 · 1 comment
Closed

Unable to register new user #1

ASoldo opened this issue Jul 21, 2022 · 1 comment

Comments

@ASoldo
Copy link

ASoldo commented Jul 21, 2022

Hi, I have cloned your repo along with mine since I'm following your youtube tutorial. When I run your app or mine it works as expected but when I use postman to register the user I get this error in the vscode terminal:
request error] Cannot convert undefined or null to object at Function.entries (<anonymous>) at validate$1 (/C:/Users/Korisnik/Documents/nuxt3-fullstack-tutorial/.nuxt/dev/index.mjs:450:37) at validateUser (/C:/Users/Korisnik/Documents/nuxt3-fullstack-tutorial/.nuxt/dev/index.mjs:513:24) at register (/C:/Users/Korisnik/Documents/nuxt3-fullstack-tutorial/.nuxt/dev/index.mjs:632:28) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async /C:/Users/Korisnik/Documents/nuxt3-fullstack-tutorial/node_modules/h3/dist/index.mjs:420:19 at async Server.nodeHandler (/C:/Users/Korisnik/Documents/nuxt3-fullstack-tutorial/node_modules/h3/dist/index.mjs:370:7)

and this is the body:
{ "username": "myUsername", "name": "My Real Name", "email": "my.real.name@gmail.com", "password":"0123456789" }

Can you assist with this? Thank you.

@rohrig
Copy link
Member

rohrig commented Jul 23, 2022

I can help you with that. If you open up the dev tools when you send the request you can open the Payload tab. There you will see what the object being sent actually looks like.

image

{data: {username: "check", name: "check", email: "check@check.com", password: "12345678"}}

I sent the data this way in postman and got the expected response.

image

Let me know if that solves your problem.

@rohrig rohrig closed this as completed Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants