Skip to content

Instantly share code, notes, and snippets.

@PadreSVK
Created April 22, 2020 08:51
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 PadreSVK/ed939f0d43c4c1ae4ad762002fbabf19 to your computer and use it in GitHub Desktop.
Save PadreSVK/ed939f0d43c4c1ae4ad762002fbabf19 to your computer and use it in GitHub Desktop.
async update({ commit }, { token, password })
{
const result = await axios.put(
passwordChangeUrl,
{ token, password },
{ validateStatus: status => status === 404 || status === 400 }
)
switch (result.status) {
case 404:
commit("login is expired")
break
case 400:
commit("validation failed")
break
default:
this.$auth.setUserToken(result.data)
this.$router.push({name:index})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment