This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
snackbarShow: state => state.show, | |
snackbarColor: state => state.color, | |
snackbarText: state => state.text, | |
snackbarSubtext: state => state.subText, | |
snackbarTimeout: state => state.timeout | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as mutations from '../../mutation-types' | |
import * as actions from '../../action-types' | |
import auth from '../../../api/auth' | |
export default { | |
[ actions.LOGIN ] (context, credentials) { | |
return new Promise((resolve, reject) => { | |
auth.login(credentials).then(response => { | |
context.commit(mutations.LOGGED, true) | |
resolve(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AUTH MODULE | |
export const LOGIN = 'LOGIN' | |
export const LOGOUT = 'LOGOUT' | |
export const REGISTER = 'REGISTER' | |
export const REMEMBER_PASSWORD = 'REMEMBER_PASSWORD' | |
export const RESET_PASSWORD = 'RESET_PASSWORD' | |
// USERS MODULE | |
export const FETCH_USERS = 'FETCH_USERS' | |
export const UPDATE_USER = 'UPDATE_USER' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (ms) => { | |
return new Promise((resolve,reject) => { | |
setTimeout(() => { | |
resolve() | |
}, ms) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
export default { | |
login (credentials) { | |
return axios.post('/login', credentials) | |
}, | |
logout () { | |
return axios.post('/logout') | |
}, | |
register (user) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<v-avatar class="mt-1 mb-1" :size="size" > | |
<img :src="gravatarURL(user.email)" alt="avatar"> | |
</v-avatar> | |
</template> | |
<style> | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as mutations from '../../store/mutation-types' | |
import { mapGetters } from 'vuex' | |
export default { | |
computed: { | |
...mapGetters([ | |
'snackbarTimeout' | |
]) | |
}, | |
methods: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gravatar from 'gravatar' | |
export default { | |
methods: { | |
gravatarURL (email) { | |
return gravatar.url(email) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* We'll load the axios HTTP library which allows us to easily issue requests | |
* to our Laravel back-end. This library automatically handles sending the | |
* CSRF token as a header based on the value of the "XSRF" token cookie. | |
*/ | |
window.axios = require('axios'); | |
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* First we will load all of this project's JavaScript dependencies which | |
* includes Vue and other libraries. It is a great starting point when | |
* building robust, powerful web applications using Vue and Laravel. | |
*/ | |
require('./bootstrap'); | |
window.Vue = require('vue'); |