2018-10-26 06:16:23 -07:00
|
|
|
const oauth = {
|
|
|
|
state: {
|
2019-05-22 09:13:41 -07:00
|
|
|
clientId: false,
|
|
|
|
clientSecret: false,
|
|
|
|
token: false,
|
|
|
|
clientToken: false
|
2018-10-26 06:16:23 -07:00
|
|
|
},
|
|
|
|
mutations: {
|
2019-05-22 09:13:41 -07:00
|
|
|
setClientData (state, { clientId, clientSecret }) {
|
|
|
|
state.clientId = clientId
|
|
|
|
state.clientSecret = clientSecret
|
|
|
|
},
|
|
|
|
setClientToken (state, token) {
|
|
|
|
state.clientToken = token
|
2018-10-26 06:16:23 -07:00
|
|
|
},
|
|
|
|
setToken (state, token) {
|
|
|
|
state.token = token
|
|
|
|
}
|
2019-05-22 09:13:41 -07:00
|
|
|
},
|
|
|
|
getters: {
|
|
|
|
getToken: state => () => {
|
|
|
|
return state.token || state.clientToken
|
|
|
|
}
|
2018-10-26 06:16:23 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default oauth
|