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