Commit a8b75d2d authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

add necessary guards and stuff for api and door routes

parent 348abe58
......@@ -66,7 +66,7 @@ class Kernel extends HttpKernel
],
'door' => [
AuthenticateDoors::class,
'auth:door',
'bindings',
],
];
......@@ -81,7 +81,6 @@ class Kernel extends HttpKernel
protected $routeMiddleware = [
'auth' => Authenticate::class,
'auth.basic' => AuthenticateWithBasicAuth::class,
'auth.basic.api' => AuthenticateAPIUser::class,
'bindings' => SubstituteBindings::class,
'cache.headers' => SetCacheHeaders::class,
'can' => Authorize::class,
......
<?php
namespace App\Http\Middleware;
use Closure;
class AuthenticateAPIUser
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
return $next($request);
}
}
<?php
namespace App\Http\Middleware;
use Closure;
class AuthenticateDoors
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
return $next($request);
}
}
......@@ -14,3 +14,9 @@ use Illuminate\Support\Facades\Route;
| All incoming requests will be authenticated doors.
|
*/
Route::get(
'door/',
static function () {
return ['yeet'];
}
);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment