Skip to content

makah/sails-social-auth-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sails.js Social Authentication Example

Learning SailsJS using PassportJS.

Phase 1

  1. Create project in Cloud9
  2. Create project sails-social-auth-example using Sails
  3. First Commit

Fase 2

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

About

Sails.js with Passport Social Auth example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published