Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Fix incorrect url to reset password
Browse files Browse the repository at this point in the history
In the email to reset user's password, the url to reset password was
incorrect as follows:

1. The port number in its authority part was missed.
2. The scheme was fixed to http.
  • Loading branch information
Yi EungJun committed May 20, 2015
1 parent cbff15a commit 5056d18
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/controllers/PasswordResetApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import utils.Config;
import utils.Constants;
import utils.PasswordReset;
import utils.Url;
import views.html.site.lostPassword;
import views.html.user.login;
import views.html.user.resetPassword;
Expand Down Expand Up @@ -92,11 +93,7 @@ private static boolean sendPasswordResetMail(User user, String hashString) {
}

private static String getResetPasswordUrl(String hashString) {
Configuration config = play.Play.application().configuration();
String hostname = config.getString("application.hostname");
if(hostname == null) hostname = request().host();

return "http://" + hostname + "/resetPassword?s=" + hashString;
return Url.create(controllers.routes.PasswordResetApp.resetPasswordForm(hashString).url());
}

public static Result resetPasswordForm(String hashString){
Expand Down

0 comments on commit 5056d18

Please sign in to comment.