At the moment, you are hashing users' passwords inside the same function that posts them to your database.
I would recommend that you separate your bcrypt logic from your SQL query logic, since they handle different things. Modularising functions (saving them in different files) will help you to manage your codebase in larger projects, and to enforce separation of concerns (see the first paragraph here).
At the moment, you are hashing users' passwords inside the same function that posts them to your database.
I would recommend that you separate your bcrypt logic from your SQL query logic, since they handle different things. Modularising functions (saving them in different files) will help you to manage your codebase in larger projects, and to enforce separation of concerns (see the first paragraph here).