Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

React-Native 项目中怎么使用 passportjs ?

$
0
0

例如 webapp 中使用:

import passport from 'passport';
import openidStrategy from 'passport-openid';
passport.use(new openidStrategy({
    callbackURL: config.creds.returnURL,
    clientID: config.creds.clientID,
    clientSecret: config.creds.clientSecret
  },
  function(done) {
    //....
  }
)

app.get('/login',
  passport.authenticate('openidconnect', { failureRedirect: '/login' }),
  function(req, res) {
    res.redirect('/');
});

那React-Native 项目中呢?


Viewing all articles
Browse latest Browse all 14821

Trending Articles