From 88bed420b182eee0b96478139655672f9634b486 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 13 Mar 2017 19:25:29 +0200 Subject: [PATCH] Show contact email on error screen --- app/Http/Middleware/Authenticate.php | 7 +++++-- resources/views/error.blade.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index e19afd0cc671..6bb6f4dc7765 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -58,8 +58,7 @@ class Authenticate if ($contact_key) { $contact = $this->getContact($contact_key); - } elseif (! empty($request->invitation_key)) { - $invitation = $this->getInvitation($request->invitation_key); + } elseif ($invitation = $this->getInvitation($request->invitation_key)) { $contact = $invitation->contact; Session::put('contact_key', $contact->contact_key); } else { @@ -104,6 +103,10 @@ class Authenticate */ protected function getInvitation($key) { + if (! $key) { + return false; + } + // check for extra params at end of value (from website feature) list($key) = explode('&', $key); diff --git a/resources/views/error.blade.php b/resources/views/error.blade.php index 1ae3d0cb0d66..073720abf895 100644 --- a/resources/views/error.blade.php +++ b/resources/views/error.blade.php @@ -9,7 +9,7 @@

{{ trans('texts.error_title') }}...

{{ $error }}

-

{{ trans('texts.error_contact_text', ['mailaddress' => env('MAIL_USERNAME')]) }}

+

{{ trans('texts.error_contact_text', ['mailaddress' => env('CONTACT_EMAIL', env('MAIL_USERNAME'))]) }}