Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const actions = {
- login ({commit}, creds) { // need to commit here
- commit('toggleLoading')
- api.authenticate({
- strategy: 'local',
- ...creds
- })
- .then(function (result) {
- return api.passport.verifyJWT(result.accessToken)
- })
- .then(function ({commit}, payload) { //need to commit here
- console.log(commit)
- return api.service('users').get(payload.userId)
- .subscribe(commit('setUser', user)) // need to commit here - but commit is not a function error
- })
- .catch(function ({commit}, error) {
- commit('setErr', `ERROR AUTHENTICATING: {$err.message}`) // need to commit here but commit is not a function error
- commit('toggleLoading')
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement