mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
reset the ApiToken on password changes/resets (#15433)
* reset the ApiToken on password changes/resets * fix/add tests * fix(typo): test grammar * update new API Token Strings, removed unused one --------- Co-authored-by: Kalista Payne <sabrecat@gmail.com>
This commit is contained in:
@@ -158,7 +158,14 @@ export default {
|
||||
confirmPassword: this.passwordUpdates.confirmPassword,
|
||||
};
|
||||
|
||||
await axios.put('/api/v4/user/auth/update-password', localAuthData);
|
||||
const updatePasswordResult = await axios.put('/api/v4/user/auth/update-password', localAuthData);
|
||||
|
||||
const newToken = updatePasswordResult.data.data.apiToken;
|
||||
|
||||
this.$store.dispatch('auth:setNewToken', {
|
||||
userId: this.user._id,
|
||||
apiToken: newToken,
|
||||
});
|
||||
|
||||
this.passwordUpdates = {};
|
||||
this.$store.dispatch('snackbars:add', {
|
||||
|
||||
Reference in New Issue
Block a user