diff --git a/app/Http/Controllers/ClientPortal/ContactHashLoginController.php b/app/Http/Controllers/ClientPortal/ContactHashLoginController.php index 51ca60adf347..c1280ff8bdc6 100644 --- a/app/Http/Controllers/ClientPortal/ContactHashLoginController.php +++ b/app/Http/Controllers/ClientPortal/ContactHashLoginController.php @@ -51,7 +51,7 @@ class ContactHashLoginController extends Controller return render('generic.error', ['title' => session()->get('title'), 'notification' => session()->get('notification')]); } - private function setRedirectPath() + private function setRedirectPath() { if(auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES) diff --git a/app/Http/Middleware/ContactKeyLogin.php b/app/Http/Middleware/ContactKeyLogin.php index 93d2c1edf423..9891236cfbd5 100644 --- a/app/Http/Middleware/ContactKeyLogin.php +++ b/app/Http/Middleware/ContactKeyLogin.php @@ -123,6 +123,8 @@ class ContactKeyLogin return redirect($this->setRedirectPath()); } } + //28-02-2022 middleware should not allow this to progress as we should have redirected by this stage. + abort(404, "Unable to authenticate."); return $next($request); } diff --git a/app/Http/Middleware/SetInviteDb.php b/app/Http/Middleware/SetInviteDb.php index 4b8e8cdcbfe9..914fdbf536fc 100644 --- a/app/Http/Middleware/SetInviteDb.php +++ b/app/Http/Middleware/SetInviteDb.php @@ -46,6 +46,9 @@ class SetInviteDb if($entity == "pay") $entity = "invoice"; + if(!in_array($entity, ['invoice','quote','credit','recurring_invoice'])) + abort(404,'I could not find this resource.'); + /* Try and determine the DB from the invitation key STRING*/ if (config('ninja.db.multi_db_enabled')) {