Richard Jones avatar Richard Jones committed 9e4c9e4

force HTTPS in the link sent for password reset

Comments (0)

Files changed (1)

             self.write_template('message.pt', title="Resending registration key",
                 message='Email with registration key resent')
 
-        # generate a reset OTK and mail the link
-        info = dict(name=user['name'], url=self.config.url,
-            otk=self._gen_reset_otk(user))
+        # generate a reset OTK and mail the link - force link to be HTTPS
+        url = self.config.url
+        if url.startswith('http'):
+            url = 'https' + url[4:]
+        info = dict(name=user['name'], url=url, otk=self._gen_reset_otk(user))
         info['admin'] = self.config.adminemail
         self.send_email(user['email'], password_change_message % info)
         self.write_template('message.pt', title="Request password reset",
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.