Adding users for login
Follow some standards, use code linting (for example ESLint) and code formatting (for example Prettier), try to prevent code duplication as much as possible, 
use design patterns and don't complex things. Those things will make your code more readable for others.

There is no right or wrong while the code works and it's easy to read.



Martin Fowler. 


  Any fool can write code that a computer can understand. Good
  programmers write code that humans can understand.