This commit is contained in:
2025-12-26 02:44:15 +01:00
parent 9fb863365c
commit 811d3df7a0
11 changed files with 589 additions and 75 deletions

View File

@@ -24,9 +24,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
try {
$auth = new \App\Auth($app);
$userId = $auth->register($displayName, $email, $password);
$_SESSION['user_id'] = $userId;
$app->flash()->set('success', 'Willkommen! Dein Account wurde erstellt.');
redirect('/dashboard');
$code = $auth->createVerifyCode($userId, $email);
$mailer = new \App\Mailer($app);
$mailer->sendTemplate('registration_confirm', $email, [
'code' => $code,
'display_name' => $displayName,
]);
$_SESSION['verify_email'] = $email;
$app->flash()->set('info', 'Bitte bestätige deine Registrierung mit dem Code aus der E-Mail.');
redirect('/verify');
} catch (\Throwable $e) {
$error = $e->getMessage();
}