Created
April 22, 2020 08:51
-
-
Save PadreSVK/ed939f0d43c4c1ae4ad762002fbabf19 to your computer and use it in GitHub Desktop.
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
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