Added a brief comment explanation of how passport strategy works
parent
3d33f55a95
commit
36a02ac982
|
@ -38,6 +38,21 @@ passport.use(new LocalStrategy({ usernameField: 'email' }, function(email, passw
|
|||
});
|
||||
}));
|
||||
|
||||
/**
|
||||
* OAuth Strategy Overview
|
||||
*
|
||||
* - User is already logged in.
|
||||
* - Check if there is an existing account with a provider id or email.
|
||||
* - If there is, return an error message. (Account merging not supported)
|
||||
* - Else link new OAuth account with currently logged-in user.
|
||||
* - User is not logged in.
|
||||
* - Check if it's a returning user.
|
||||
* - If returning user, sign in and we are done.
|
||||
* - Else check if there is an existing account with user's email.
|
||||
* - If there is, return an error message.
|
||||
* - Else create a new account.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sign in with Facebook.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue