Home > Net >  NestJS Communicate with the client
NestJS Communicate with the client

Time:11-07

So, when you make a POST request to the NestJS API, it saves the data to a MongoDB server.And is there any when to let the client know that the registration for example is finished successfully and ready redirect the user or anything else?

My code returns this:

img.

Codes: register.controller.ts img

register.service.ts img

users.repository.ts img

I dont really know what to do right now with this.

CodePudding user response:

It seems that you return the result of creating a new user in your MongoDB.

Instead of this you can simply return true/false value or if you use JWT, you probably need to return the auth-token for next user's requests.

You can find more about Authenctication info in official guide of Nestjs

  • Related