Reset password not working- Moralis.User.requestPasswordReset

for me also password reset does not work, not sure if the troubles mentioned of the forum have been addressed.
https://5q6ce5oht43m.moralis.io:2053/server v0.0.242

Iā€™m calling client side:

      Moralis.User.requestPasswordReset(email.value)
      .then(() => {
        // Password reset request was sent successfully
      }).catch((error) => {
        // Show the error message somewhere
        alert("Error: " + error.code + " " + error.message);
      })

and I get an alert with ā€œError: 1 undefinedā€ and these headers:

Request URL: https://5q6ce5oht43m.moralis.io:2053/server/requestPasswordReset
Request Method: POST
Status Code: 500 
Remote Address: 104.26.4.173:2053
Referrer Policy: strict-origin-when-cross-origin
access-control-allow-headers: X-Parse-Master-Key, X-Parse-REST-API-Key, X-Parse-Javascript-Key, X-Parse-Application-Id, X-Parse-Client-Version, X-Parse-Session-Token, X-Requested-With, X-Parse-Revocable-Session, X-Parse-Request-Id, Content-Type, Pragma, Cache-Control, X-Parse-Installation-Id
access-control-allow-methods: GET, PUT, POST, DELETE, HEAD, OPTIONS, PATCH, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK
access-control-allow-origin: *
access-control-expose-headers: X-Parse-Job-Status-Id, X-Parse-Push-Status-Id
cf-cache-status: DYNAMIC
cf-ray: 674db085cd731e91-AMS
content-length: 45
content-type: application/json; charset=utf-8
date: Mon, 26 Jul 2021 12:39:13 GMT
etag: W/"2d-w030VvQp6oxnghmIU/h559WBxgM"
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
nel: {"report_to":"cf-nel","max_age":604800}
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=WBS41MZHTyrCZzFVzYhd3EI7%2BR5wDHqJB%2BE89EYnlCDyhGTjybZ7px5S1El%2FdfO0C88UyPGxkZrkGKrMf89%2BRvKOqSt0zvHVflyVbymgu92j4smK4d3dCMdN%2FnoRF%2FQx9eDOZDguwOisLQNZgIQ%3D"}],"group":"cf-nel","max_age":604800}
server: cloudflare
x-powered-by: Express
:authority: 5q6ce5oht43m.moralis.io:2053
:method: POST
:path: /server/requestPasswordReset
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cache-control: no-cache
content-length: 177
content-type: text/plain
origin: http://localhost:8080
pragma: no-cache
referer: http://localhost:8080/
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
sec-gpc: 1
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
{email: "[email protected]", _ApplicationId: "xxx",ā€¦}
email: "[email protected]"
_ApplicationId: "xxx"
_ClientVersion: "js0.0.25"
_InstallationId: "xxx"

Calling from locahost but on my server also not working.
Server log says ā€œUncaught internal server error.ā€

Also, is it possible to use our own Sendgrid template for the mail?

Cheers.

We have this as a pending issue in our bucket list.

There are other devs facing the issue over here -

and here

Hope this helps. Thank you for your continuous support! :raised_hands:

sure no worries, I understand youā€™re all crazy busy wow. Same here, building on Moralis and soon reaching production status. Iā€™m building an internal management platform though, so I can live with things not being 100% yet.
I saw the other reports but itā€™s sometimes not clear what is still pending and being worked on.
So I just report what I encounter.
All good, heads up :slight_smile:

1 Like

Hi @matiyin,

We have fixed the password Reset issue. You should be able to send them to your Moralis users. Please try again and see.

Also, we have updated the docs with the new settings to help you navigate better. Do check it out!
https://docs.moralis.io/sending-email

https://docs.moralis.io/users/reset-password

Thank you for pointing out these issues. All your feedback goes a long way! Thank you! :star_struck:

Thanks, Iā€™ve tested it now reading again the documentation and adding a Template Id for the Reset Password mail.
I receive the mail, but I donā€™t know which params I should/can use in the email template.
I tried just putting {{html}} but nothing is showing up.
In my custom email functions I add params myself but for the Reset mail I donā€™t know what to set with using Moralis.User.requestPasswordReset(email) or how to insert your generated link into the template. I believe nothing is mentioned about this in the docs.

Cheers.

Hello!

You are right, Just updated the docs showing the parameters sent to the dynamic template

https://docs.moralis.io/sending-email#dynamic-template-data

1 Like

Thanks!

One more thing: can I add my own params too? I see thereā€™s something for an ā€˜options objectā€™ but this doesnā€™t work:

 Moralis.User.requestPasswordReset(email.value, { appName: appName.value, appUrl:appUrl.value })

Your function:

  /**
     * Requests a password reset email to be sent to the specified email address
     * associated with the user account. This email allows the user to securely
     * reset their password on the Parse site.
     *
     * @param {string} email The email address associated with the user that
     *     forgot their password.
     * @param {object} options
     * @static
     * @returns {Promise}
     */

  }, {
    key: "requestPasswordReset",
    value: function (email
    /*: string*/
    , options
    /*:: ?: RequestOptions*/
    ) {
      options = options || {};
      var requestOptions = {};

      if (options.hasOwnProperty('useMasterKey')) {
        requestOptions.useMasterKey = options.useMasterKey;
      }

      var controller = _CoreManager.default.getUserController();

      return controller.requestPasswordReset(email, requestOptions);
    }

Please make a new thread.