-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/ode 50 create authentication service #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/ode 50 create authentication service #11
Conversation
| // Generate an auth token for the user | ||
| const user = this; | ||
| // eslint-disable-next-line no-underscore-dangle | ||
| const token = jwt.sign({ _id: user._id }, process.env.JWT_KEY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phần này anh không cần cho thêm hạn sử dụng của token à anh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do dự án mình login chỉ để lấy thông tin, email người dùng thôi. Và anh muốn người ta không cần phải đăng nhập nhiều. Nên mình không cần expire.
| const UserSchema = new Schema( | ||
| const UserSchema = Schema( | ||
| { | ||
| email: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
email thiếu unique ạ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ủa có rồi mà e :D
Implementations