def reset_password(self, token, password): username, error = userdb.update_user_password_from_token( token, password) if error is None: self.logger.info("User %s has completed their password reset.", username) self.send_message("reload_url") else: if username is None: self.logger.info("Failed to update password for token %s: %s", token, error) else: self.logger.info("Failed to update password for user %s: %s", username, error) self.send_message("reset_password_fail", reason=error)
def reset_password(self, token, password): if not getattr(config, "allow_password_reset", False): return username, error = userdb.update_user_password_from_token(token, password) if error is None: self.logger.info("User %s has completed their password reset.", username) self.send_message("reload_url") else: if username is None: self.logger.info("Failed to update password for token %s: %s", token, error) else: self.logger.info("Failed to update password for user %s: %s", username, error) self.send_message("reset_password_fail", reason = error)