-
Password cannot be plain (DONE)
-
When show user it should show the password (DONE)
-
How to login logout (DONE)
-
how to ensure other endpoint need to validate before going to api (DONE)
//http://localhost:8080/api/v1/login ///////////////////////////////////////////////////////////////////////////////// Run npm install npm run dev
-
Login -> /login -> await bcrypt.compare(password, user.password) -> user.generateAuthToken() -> return user (with return a jwt token)
-
http://localhost:8080/api/v1/posts -> authMiddleware.isAuth (check is valid JWT Token) -> postController.index (return all the post if valid)
//////////////////////////////////////////////////////////////////////////////