Skip to content

Files

Latest commit

 

History

History

facebook-auth

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sample - Facebook authentication

Use Facebook Login SDK on browser and check the user rights on server side.

Setup

Install

  • 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

Facebook Config

  1. You need to create a Facebook App in the Developers Console and add Facebook Login on it.

  2. Open the src/index.js file

  3. 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

# 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.

  1. Go to Developers Console and open your application details

  2. In Facebook Login tab, open settings

  3. Add Your URL (eg. https://xxxxxx.scaledynamics.cloud) in the Valid OAuth Redirect URIs field.

Resources