Skip to content

Instantly share code, notes, and snippets.

@lesovsky
Last active July 13, 2019 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesovsky/a517b71aee36296183c87fdb411107e5 to your computer and use it in GitHub Desktop.
Save lesovsky/a517b71aee36296183c87fdb411107e5 to your computer and use it in GitHub Desktop.
auth-guard.js
import axios from 'axios'
export default {
doAction (to, from, next) {
axios.post('http://127.0.0.1:1080/api/v2/action', {"data":"..."})
.then(request => this.actionSuccessful(request))
.catch(() => this.actionFailed())
},
actionSuccessful (req) {
...
},
actionFailed () {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment