Use Facebook Login SDK on browser and check the user rights on server side.
- Clone the project
- Go to the
warp-samples/facebook-auth
directory - Run the following commands:
# install deps
$ npm install
# login to ScaleDynamics
$ npx warp login
-
You need to create a Facebook App in the Developers Console and add Facebook Login on it.
-
Open the
src/index.js
file -
Update the
FACEBOOK_APP_ID
value with yours
// initialize Facebook SDK
window.fbAsyncInit = () => {
FB.init({
appId: 'FACEBOOK_APP_ID',
version: 'v6.0',
cookie: true,
status: true,
xfbml: true
})
# run a dev server
$ npm run dev
# build and deploy to production
$ npm run build
$ npm run deploy
After deploying, you have to add your domain to secure your application.
-
Go to Developers Console and open your application details
-
In Facebook Login tab, open settings
-
Add Your URL (eg. https://xxxxxx.scaledynamics.cloud) in the
Valid OAuth Redirect URIs
field.