waterlock-facebook-auth is a module for waterlock providing a facebook authentication method for users either based on username.
npm install waterlock-facebook-auth
set the following option in your waterlock.js
config file
authMethod: [
{
name: "waterlock-facebook-auth",
appId: "your-app-id",
appSecret: "your-app-secret"
}
]
Direct your user to /auth/login?type=facebook
will initiate the oauth request. The callback uri is /auth/facebook_oauth2
if successfuly authenticated a user record will be created if a user is not found one will be created using the waterlines findOrCreate
method
If you are using sails blueprints and have pluralized your REST API you can configure waterlock to pluralize the auth endpoints by including pluralizeEndpoints=true in the waterlock.js file:
module.exports.waterlock = {
pluralizeEndpoints: true
}