var config = require('../../config.json');
var Axios = require('axios')
module.exports = function (req, res, next) {
Axios.post('https://graph.facebook.com/v2.4/oauth/access_token', {
client_id: config.auth.facebook.clientId,
client_secret: config.auth.facebook.clientSecret,
code: req.body.code,
redirect_uri: req.body.redirectUri
}, { 'Content-Type': 'application/json' }).then(function (response) {
var responseJson = response.data
res.json(responseJson)
}).catch(function (err) {
res.status(500).json(err)
})
}
koa
with koa-passport
, and succeed authentication return ctx.body = {success: true}
to client. Needed more? Needed token?
ctx.login(user)
?
All session data in cookies? 0_o
- JWT is stored in either localStorage
, sessionStorage
or in app memory. Custom made cookieStorage
is yet to be released in some future version.
TypeError: Cannot read property 'authenticate' of undefined
: https://stackoverflow.com/questions/46940420/vueauthenticate-uncaught-typeerror-cannot-read-property-login-of-undefined
Vue.use(VueAuthenticate)
import VueAuthenticate from 'vue-authenticate'
import { VueAuthenticate } from 'vue-authenticate'
const vueAuth = new VueAuthenticate(VueResource, {})
I have always the same problem.
main.js: https://pastebin.com/SQtVx6Kg
auth.js: https://pastebin.com/vyvm3MLA
store.js: https://pastebin.com/YNq21nkc