Richard Jones avatar Richard Jones committed c874c43

fixes

Comments (0)

Files changed (1)

 
         # generate a reset OTK and mail the link
         info = dict(name=user['name'], url=self.config.url,
-            otk=self._gen_reset_otk())
+            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",
 
         # generate a reset OTK and mail the link
         info = dict(name=user['name'], url=self.config.url,
-            otk=self._gen_reset_otk())
+            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",
             message='Email sent to confirm password change')
 
-    def _gen_reset_otk(self):
+    def _gen_reset_otk(self, user):
         # generate the reset key and sign it
         reset_signer = itsdangerous.URLSafeTimedSerializer(
-            self.config[reset_secret], 'password-recovery')
+            self.config.reset_secret, 'password-recovery')
 
         # we include a snip of the current password hash so that the OTK can't
         # be used again once the password is changed. And hash it to be extra
 
     def _decode_reset_otk(self, otk):
         reset_signer = itsdangerous.URLSafeTimedSerializer(
-            self.config[reset_secret], 'password-recovery')
+            self.config.reset_secret, 'password-recovery')
         try:
             # we allow 6 hours
             name, x = reset_signer.loads(otk, max_age=6*60*60)
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.