Learning SailsJS using PassportJS.
- Install Passport using Giancarlo Soverini tutorial - commit
- Create a private area that only logged user could enter (with logout function) - commit
- Create a flash message alerting users when they are not logged - commit
- Info: O Chrome sends two POST. I did an workaround that sends only one message
- Info: In the future I will use AngularJS and receive messages via JSON, so I don't need a complex use of flash() messages
- I could've use 'FlashService' + 'flash' policy, but It is too complex for my use right now
- Using this ideia for a simple req.flash(). Create a partial EJS to handle flash messages in client side
- Study: Send encrypted password (client -> server)
- It's not a good idea. The default is plain text + HTTPS
- Explanation¹
- Javascript Cryptography
- Forgot password
- Steps: (User ask to reset password via /forgotPassword) -> (Server sends an email) -> (User define a new password using token received in email) -> (Server update password and discard token). Used tutorial writen by Sahat Yalkabov
- Allow Sails to send email via sails-hook-email (it's hard to configure) - commit
- Allow password reset and verify token expiration - commit
- Google Login commit
- Follow Google API steps - Tutorial do Jenkins
- Implement Google Auth via passport-google-oauth follow tutorial written by sails-social-auth-example and Michael Herman
- Note that we don't need to use google/callback - FIX
- This Stackoverflow's question could help.