Fixed CP password reset

This commit is contained in:
Pinga 2024-01-15 13:44:39 +02:00
parent fbc62d587f
commit af5bbacfe7
6 changed files with 77 additions and 36 deletions

View file

@ -32,8 +32,11 @@ class PasswordController extends Controller
* @throws \Pinga\Auth\AuthError
*/
public function forgotPassword(Request $request, Response $response){
global $container;
$db = $container->get('db');
$data = $request->getParsedBody();
Auth::forgotPassword($data['email']);
$username = $db->selectValue('SELECT username FROM users WHERE email = ?', [$data['email']]);
Auth::forgotPassword($data['email'],$username);
}
/**