akveo / ngx-admin-bundle-support

Support repository for ngx-admin backend bundles with issues tracking, instructions and code samples
58 stars 32 forks source link

node-js / mongo starter bundle - new user registration not working #49

Closed bestops closed 4 years ago

bestops commented 4 years ago

"node-js / mongo starter bundle - new user registration not working"

Started mongodb as a docker container (mongo:latest). Start the backend at http://localhost:3001 Start the frontend/

Register a new user with username and password.

And then when 'logging in', you get the home page MOMENTARILY.. and then the screen goes back to the registration screen. Same behavior if you use a different tab, different window, different browser altogether.

The user account is NOT created in the users collection of the mongodb (as evident from mongoexport of that collection).

Backend:

{"message":"Connecting to MongoDB client...","level":"info"}
{"message":"Seed Data","level":"info"}
{"message":"Server start listening port: 3001","level":"info"}
{"message":"MongoDB client has been successfully created","level":"info"}
{"message":"Seed Data","level":"info"}
{"message":"Seed Users Done","level":"info"}
{"message":"Seed User Activities Done","level":"info"}
{"message":"Seed Orders Done","level":"info"}
{"message":"Seed Traffic Done","level":"info"}
bestops commented 4 years ago

When trying to use one of the seeded users like Rostand_Simon@user.com , the frontend thinks the email is invalid. The seed user is present in the users collection of mongodb. This is a frontend issue, I realize, but there is no way to start using the nodejs/mongo starter bundle until the main backend issue (creating new users) is resolved.

bestops commented 4 years ago

ignore it.. found what the bug was.. The frontend is the problem. The default file environment.ts is still talking to your azurewebsites demo site. It is a security hole and a bug to refer to that site in your delivered product. The right apiUrl should be localhost:3001 for dev environment and for production, you should leave it as localhost:3002 to match the backend (you should definitely update the instructions though..). Closing.