Password reset throws Internal Server Error


#1

Hello everyone,

The code below throws Internal Server Error and when I view the response in dev tools I see “Whoops, looks like something went wrong.”. I have other calls to the API work fine so it appears to be specific to resetting passwords. I’ve also tried “/api/v2/user/password?reset=true” but I get the same error. Any help is appreciated. Thanks!

this.resetpassword = function(data) {
var deferred = $q.defer();
var ep = ‘https://api.removed.com/api/v2/user/password’;
var options = {
‘email’: data.email,
‘reset’: true
}
$http.post(ep, options).then(function(result) {
console.log(result);
}, function(error) {
deferred.reject({‘error’:{‘email’:‘no-lookup’,‘inner’:error}});
});
return deferred.promise;
};


#2

Hi @tjenicek,
The reset is a query param, and not payload body.

this.resetpassword = function(data) {
  var deferred = $q.defer();
  var ep = 'https://api.removed.com/api/v2/user/password?reset=true';
  var options = {
    'email': data.email
  }

  $http.post(ep, options).then(function(result) {
    console.log(result);
  }, function(error) {
    deferred.reject({'error':{'email':'no-lookup','inner':error}});
  });
  
  return deferred.promise;
};

#3

Thanks for the reply juniorconte. I tried it that way and now I’m getting “No security question found or email confirmation available for this user. Please contact your administrator.”. We aren’t using the security question, is that required in order for this to work? Does the second part of the message mean the email wasn’t found? It’s definitely in the database.


#4

Probably you are missing and set the mail service and the template in the user service configuration.

In your admin app, go to:

Services > user > config > Password Email Service (select your email service)

  • in my case is “Local email Service”

and

Services > user > config > Password Email Template (select your email template)

  • in my case is “Password Reset Default”

#5

I set both of the config settings and am now getting a status 200 from the API but no email is going out. Are there additional settings that need to updated?


#6

Now are the settings for your email service. recommend you try to send mail directly through the API docs to try to identify the problem.

I believe that the service email documentation will help you http://wiki.dreamfactory.com/DreamFactory/Tutorials/Connecting_to_Email_Services

If you have problems, speak again :slight_smile:


#7

Hi,

I am having the same issue I am using DF v2.7.

I created a new service called AmazonEmailService which is using Amazon SES - the services work perfectly when tested using API doc.

When I go to Services > user > config > Password Email Service (select your email service)

  • I do not see anything to select in the dropdown.

Kindly Help!!

Thanks
Saurabh