Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Facebook passport Oauth authenticate strategy

app.get('/auth/facebook',
  passport.authenticate('facebook'));

app.get('/auth/facebook/callback',
  passport.authenticate('facebook', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });
Comment

Facebook passport Oauth

passport.use(new FacebookStrategy({
    clientID: FACEBOOK_APP_ID,
    clientSecret: FACEBOOK_APP_SECRET,
    callbackURL: "http://localhost:3000/auth/facebook/callback"
  },
  function(accessToken, refreshToken, profile, cb) {
    User.findOrCreate({ facebookId: profile.id }, function (err, user) {
      return cb(err, user);
    });
  }
));
Comment

Facebook passport Oauth

passport.use(new FacebookStrategy({
    clientID: FACEBOOK_APP_ID,
    clientSecret: FACEBOOK_APP_SECRET,
    callbackURL: "http://localhost:3000/auth/facebook/callback"
  },
  function(accessToken, refreshToken, profile, cb) {
    User.findOrCreate({ facebookId: profile.id }, function (err, user) {
      return cb(err, user);
    });
  }
));
Comment

PREVIOUS NEXT
Code Example
Javascript :: eas build apk 
Javascript :: how to define args using param discord.js 
Javascript :: add sass autoprefixer to react 
Javascript :: angular elementref 
Javascript :: changing color of console log 
Javascript :: javascript store text file into string 
Javascript :: queryselector data attribute 
Javascript :: jquery textarea autosize 
Javascript :: refresh after delete in node 
Javascript :: find smallest number in array js 
Javascript :: nestjs change httpcode inside function 
Javascript :: react run on route change 
Javascript :: lodash deep compare two objects 
Javascript :: jsconfig.json 
Javascript :: start angular app server 
Javascript :: how to upload file in material ui 
Javascript :: react include a polyfill webpack v5 
Javascript :: faker.js name 
Javascript :: var_dump in javascript 
Javascript :: react on focus out 
Javascript :: difference between call and apply in js 
Javascript :: add element to array javascript 
Javascript :: datatables dynamically hide columns 
Javascript :: javascript detect if element is scrolled 
Javascript :: discord.js find role by name 
Javascript :: bootstrap icons react 
Javascript :: javascript check if array has duplicates 
Javascript :: rect p5js 
Javascript :: css and js on flask 
Javascript :: make event nodejs 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =