We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use this for backend but the middleware is always return true What should we do?
Kernel.php
protected $middlewareAliases = [ 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class, 'signed' => \App\Http\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, '2fa' => \PragmaRX\Google2FALaravel\Middleware::class, ];
Middleware.php
public function handle($request, Closure $next) { $authenticator = app(Authenticator::class)->boot($request); //return response()->json($authenticator); if ($authenticator->isAuthenticated()) { return $next($request); } return $authenticator->makeRequestOneTimePasswordResponse(); }
Routes api.php Route::get('/home', [HomeController::class, 'index'])->middleware(['2fa', 'throttle']);
Route::get('/home', [HomeController::class, 'index'])->middleware(['2fa', 'throttle']);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I use this for backend but the middleware is always return true
What should we do?
Kernel.php
Middleware.php
Routes
api.php
Route::get('/home', [HomeController::class, 'index'])->middleware(['2fa', 'throttle']);
The text was updated successfully, but these errors were encountered: