yxxx
This commit is contained in:
@@ -15,8 +15,19 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$password = (string)($_POST['password'] ?? '');
|
||||
try {
|
||||
$auth = new \App\Auth($app);
|
||||
$userId = $auth->login($email, $password);
|
||||
$_SESSION['user_id'] = $userId;
|
||||
$res = $auth->login($email, $password);
|
||||
if ($res['status'] === 'pending') {
|
||||
$code = $auth->createVerifyCode($res['id'], $email);
|
||||
$mailer = new \App\Mailer($app);
|
||||
$mailer->sendTemplate('registration_confirm', $email, [
|
||||
'code' => $code,
|
||||
'display_name' => $email,
|
||||
]);
|
||||
$_SESSION['verify_email'] = $email;
|
||||
$app->flash()->set('info', 'Bitte bestätige deine Registrierung mit dem Code aus der E-Mail.');
|
||||
redirect('/verify');
|
||||
}
|
||||
$_SESSION['user_id'] = $res['id'];
|
||||
$app->flash()->set('success', 'Erfolgreich angemeldet.');
|
||||
redirect('/dashboard');
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
Reference in New Issue
Block a user