I solved it.
methods: {
async resetPassword() {
this.error = null;
if (this.password1 !== this.password2) {
this.error = "Passwords do not match.";
return;
}
try {
await this.$axios.post("/auth/reset-password", {
code: this.$auth.ctx.query.code, // THIS IS WHERE THE CODE WAS BREAKING. WE FORGOT TO GET THE ACTUAL TOKEN FROM THE AUTH OBJECT
password: this.password1,
passwordConfirmation: this.password2,
});
this.success =
"Password updated successfully. You can now use it to log in to your account.";
} catch (e) {
this.error = e.response.data.message[0].messages[0].message;
}
},
},