User password reset returns error

Got an issue with the strapi/auth authentication.

I followed the steps (https://strapi.io/blog/strapi-authentication-in-nuxt-js ) to integrate user registration on strapi with auth. Registering and logging in works fine, but when if I want to reset the password for a given user, this gets returned on my front end:
“Incorrect params provided.”

This gets returned in the dev tools:
Failed to load resource: the server responded with a status of 400 (Bad Request)

And this on strapi:
debug POST /auth/reset-password (10 ms) 400

Also, I did enable the Public Role permission for the auth/reset-password endpoint.

Anyone, any ideas?

Hi!

I’have the same issue, 400 Bad Request with /auth/forgot-password.

1 Like

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;
  }
},
},

Hi @AlexCFurtuna, where do you get this auth object from? I’ve checked your source above and the steps are not really clear. I have added ‘@nuxtjs/auth’ in nuxt.config.js modules and auth object in nuxt.config.js, but I guess it’s not from nuxt.config.js right? my query inside context is always {}