Spaces:
Sleeping
Sleeping
Download app/Http/Middleware/isCustomUser.php from Anuj-Panthri/Learn-Guide: direct link, hf CLI and curl.
- Browser
- Download file 536 Bytes
-
https://huggingface.co/spaces/Anuj-Panthri/Learn-Guide/resolve/main/app/Http/Middleware/isCustomUser.php
- Command line
-
hf download hf://spaces/Anuj-Panthri/Learn-Guide/app/Http/Middleware/isCustomUser.php
-
curl -L -o isCustomUser.php https://huggingface.co/spaces/Anuj-Panthri/Learn-Guide/resolve/main/app/Http/Middleware/isCustomUser.php
536 Bytes
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Http\Request; | |
| use Symfony\Component\HttpFoundation\Response; | |
| use Auth; | |
| class isCustomUser | |
| { | |
| /** | |
| * Handle an incoming request. | |
| * | |
| * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next | |
| */ | |
| public function handle(Request $request, Closure $next) | |
| { | |
| if(Auth::guard('customuser')->check()){ | |
| return $next($request); | |
| } | |
| return redirect(route('login.form')); | |
| } | |
| } | |