2fa not all routes have names (#14311)

This commit is contained in:
Tony Murray
2022-09-07 02:06:24 -05:00
committed by GitHub
parent 36e9c5e0b9
commit dc050711ec

View File

@@ -21,7 +21,8 @@ class VerifyTwoFactor
// check twofactor
if (Config::get('twofactor') === true) {
// don't apply on 2fa checking routes
if (Str::startsWith($request->route()->getName(), '2fa.')) {
$route_name = $request->route()->getName();
if ($route_name && Str::startsWith($route_name, '2fa.')) {
return $next($request);
}