register wip
This commit is contained in:
1 parent
76f4127bb2
commit
7d9a28a84d
6 files changed
+295
-63
No files matched your search
@@ -4,20 +4,15 @@ namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class AppUserAGBMiddleware
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
if ($request->user()->agb_akzeptiert == 0) {
|
||||
// return static::getResource()::getUrl('index');
|
||||
abort(Response::HTTP_FORBIDDEN, 'Bitte akzeptieren sie unsere AGBs.');
|
||||
if (Auth::check() && ! Auth::user()->agb_akzeptiert) {
|
||||
abort(Response::HTTP_FORBIDDEN, 'Die Allgemeine Geschäftsbedingungen wurden nicht akzeptiert, bitte wenden Sie sich an den Adminstrator.');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
||||
Reference in new issue
Block a user