Guest User

Untitled

a guest
Sep 30th, 2018
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. await this.$auth.login({
  2. data: {
  3. email: this.email,
  4. password: this.password
  5. }
  6. }).then(() => {
  7. this.$router.push('/dashboard')
  8. }).catch(err => {
  9. this.snackbar.show = true;
  10. })
  11.  
  12. auth: {
  13. strategies: {
  14. local: {
  15. endpoints: {
  16. login: {
  17. url: '/auth/login',
  18. method: 'post',
  19. propertyName: 'access_token'
  20. },
  21. logout: {
  22. url: '/auth/logout',
  23. method: 'post'
  24. },
  25. user: {
  26. url: '/auth/me',
  27. method: 'post'
  28. },
  29. tokenRequired: true
  30. }
  31. }
  32. }
  33. }
  34.  
  35. {
  36. "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYXBpLmFwcHJleC5kZVwvYXBpXC9hdXRoXC9sb2dpbiIsImlhdCI6MTUzODI5NTczMywiZXhwIjoxNTM4Mjk5MzMzLCJuYmYiOjE1MzgyOTU3MzMsImp0aSI6ImdtWWVyZTViQjk1cU5BRG8iLCJzdWIiOjIsInBydiI6IjYwODM2NzQ0MzQ4ZDQzMTk4NzE4N2ZjMWM2YzIzMjYxMDcyMWE5ZjAifQ.JhOiwIg7StzZR71aqYyI9rJpPXVclmddzPSIwqCIUN4",
  37. "token_type": "bearer",
  38. "expires_in": 3600
  39. }
  40.  
  41. {
  42. "id": 2,
  43. "name": "Dominik Dummy",
  44. "email": "dummy@andreas-pabst.de",
  45. "created_at": {
  46. "date": "2018-09-28 09:11:31.000000",
  47. "timezone_type": 3,
  48. "timezone": "UTC"
  49. },
  50. "updated_at": {
  51. "date": "2018-09-28 09:11:31.000000",
  52. "timezone_type": 3,
  53. "timezone": "UTC"
  54. },
  55. "self": "https://api.apprex.de/api/users/2"
  56. }
Add Comment
Please, Sign In to add comment