// Start email confirmation flow if required
if ($this->emailConfirmationService->confirmationRequired() && !$emailConfirmed) {
$newUser->save();
- $message = '';
try {
$this->emailConfirmationService->sendConfirmation($newUser);
+ session()->flash('sent-email-confirmation', true);
} catch (Exception $e) {
$message = trans('auth.email_confirm_send_error');
+ throw new UserRegistrationException($message, '/register/confirm');
}
- throw new UserRegistrationException($message, '/register/confirm');
}
return $newUser;
}
}
- /**
- * Alias to the UserRepo method of the same name.
- * Attaches the default system role, if configured, to the given user.
- */
- public function attachDefaultRole(User $user): void
- {
- $this->userRepo->attachDefaultRole($user);
- }
-
}
\ No newline at end of file