almatrass / passport-opskins

A simple passport strategy for authenticating users through the OPSkins platform
MIT License
4 stars 1 forks source link

Passport opskin Throw an Error #10

Open phpnodeais opened 5 years ago

phpnodeais commented 5 years ago

I implemented following code for passport-opskins. Code reference url : https://www.npmjs.com/package/passport-opskins I attached screenshot for error

image_3r

let strat = new opStrategy({
  name: 'passport-opskins-example',
  returnURL: `http://localhost:${config.port}/auth/opskins/return`,
  apiKey: config.apiKey, //here my api key setted
  scopes: 'identity_basic', // Space-separated list of identities
  mobile: true, // Remove OPSkins NavBar
  permanent: true, // Maintain permanent access to the account
  debug: false // Displays error messages in the browser
}, (user, done) => {
  return done(null, user);
});

also I got following error


/opt/lampp/htdocs/passport-opskins/index.js:145
            throw new Error(body.message);
            ^

Error
    at Request.request.post [as _callback] (/opt/lampp/htdocs/passport-opskins/index.js:145:19)
    at Request.self.callback (/opt/lampp/htdocs/passport-opskins/node_modules/request/request.js:185:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/opt/lampp/htdocs/passport-opskins/node_modules/request/request.js:1161:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/opt/lampp/htdocs/passport-opskins/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
gustavochavarria commented 5 years ago

Please check out my PR: https://github.com/almatrass/passport-opskins/pull/9

You can use my fork: https://github.com/gustavochavarria/passport-opskins

phpnodeais commented 5 years ago

@gustavochavarria Thanks for your reply. It working fine.