Commit db04ae6b authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix(auth): handle mail failure gracefully during registration

Registration no longer crashes if email verification fails to send.
Also fix mail host: srv-captain--poste-io -> srv-captain--mail.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent e8b3839c
......@@ -33,10 +33,14 @@ class RegisterCompanyController extends Controller
{
$user = $this->authService->registerCompany($request->validated());
event(new Registered($user));
Auth::login($user);
try {
event(new Registered($user));
} catch (\Exception $e) {
report($e);
}
return $this->success(
['redirect' => '/email/verify'],
__('auth.registration_successful_company')
......
......@@ -29,10 +29,14 @@ class RegisterCreatorController extends Controller
{
$user = $this->authService->registerCreator($request->validated());
event(new Registered($user));
Auth::login($user);
try {
event(new Registered($user));
} catch (\Exception $e) {
report($e);
}
return $this->success(
['redirect' => '/email/verify'],
__('auth.registration_successful')
......
......@@ -8,7 +8,7 @@ return [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'srv-captain--poste-io'),
'host' => env('MAIL_HOST', 'srv-captain--mail'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME', 'noreply@al-arcade.com'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment