diff --git a/app/Http/Middleware/VerifyHash.php b/app/Http/Middleware/VerifyHash.php new file mode 100644 index 000000000000..f572221bac1f --- /dev/null +++ b/app/Http/Middleware/VerifyHash.php @@ -0,0 +1,37 @@ +has('payment_hash')){ + + $ph = PaymentHash::with('fee_invoice')->where('hash', $request->payment_hash)->first(); + + if($ph) + auth()->guard('contact')->loginUsingId($ph->fee_invoice->invitations->first()->contact->id, true); + + return $next($request); + + } + + abort(404, 'Unable to verify payment hash'); + } +}