X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/dec0cbb1b25d139c504923a15b4ce884562c7404..refs/pull/139/head:/app/Services/EmailConfirmationService.php diff --git a/app/Services/EmailConfirmationService.php b/app/Services/EmailConfirmationService.php index dd85ad834..c3096c654 100644 --- a/app/Services/EmailConfirmationService.php +++ b/app/Services/EmailConfirmationService.php @@ -1,15 +1,15 @@ -email_confirmed) { + if ($user->email_confirmed) { throw new ConfirmationEmailException('Email has already been confirmed, Try logging in.', '/login'); } $this->deleteConfirmationsByUser($user); @@ -45,7 +45,7 @@ class EmailConfirmationService 'token' => $token, ]); $this->mailer->send('emails/email-confirmation', ['token' => $token], function (Message $message) use ($user) { - $appName = \Setting::get('app-name', 'BookStack'); + $appName = setting('app-name', 'BookStack'); $message->to($user->email, $user->name)->subject('Confirm your email on ' . $appName . '.'); }); } @@ -66,7 +66,7 @@ class EmailConfirmationService } // If more than a day old - if(Carbon::now()->subDay()->gt($emailConfirmation->created_at)) { + if (Carbon::now()->subDay()->gt($emailConfirmation->created_at)) { $this->sendConfirmation($emailConfirmation->user); throw new UserRegistrationException('The confirmation token has expired, A new confirmation email has been sent.', '/register/confirm'); }