mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-03 05:41:52 +09:00
Reworked Password-Reset flow (#1627)
* Reworked Password-Reset flow - No more Passwords sent via E-Mail - Correct redirects. * Fixed spelling & last redirect * Small fixes and updated tests for pw-reset-flow * Fixed tests for pw-reset-flow * Fixed tests for the Password reset flow * Fixed typos, resolved Feedback * Renamed event before password reset * Renamed event after password reset * Tweak a few comments, send the reset email instantly --------- Co-authored-by: Christoph Schläpfer <c.schlaepfer@datact.ch> Co-authored-by: Belle Aerni <belleaerni@gmail.com>
This commit is contained in:
8 files changed
+296
-123
No files matched your search
@@ -63,15 +63,21 @@ class Client implements \FOSSBilling\InjectionAwareInterface
|
||||
|
||||
return $app->render($template);
|
||||
}
|
||||
|
||||
public function get_reset_password_confirm(\Box_App $app, $hash)
|
||||
{
|
||||
$api = $this->di['api_guest'];
|
||||
$service = $this->di['mod_service']('client');
|
||||
$this->di['events_manager']->fire(['event' => 'onBeforePasswordResetClient']);
|
||||
$data = [
|
||||
'hash' => $hash,
|
||||
];
|
||||
$api->client_confirm_reset($data);
|
||||
$app->redirect('/login');
|
||||
$template = 'mod_client_set_new_password';
|
||||
|
||||
// Call password_reset_valid function and if true, then render the template, otherwise redirect to the index page
|
||||
$result = $service->password_reset_valid($data);
|
||||
if ($result !== false) {
|
||||
return $app->render($template);
|
||||
} else {
|
||||
$app->redirect('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user