create-prisma-php-app 1.11.11 → 1.11.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bootstrap.php
CHANGED
|
@@ -251,14 +251,7 @@ function checkForDuplicateRoutes()
|
|
|
251
251
|
if ($basename === 'layout.php') continue;
|
|
252
252
|
|
|
253
253
|
if (count($originalRoutes) > 1 && strpos($normalizedRoute, DIRECTORY_SEPARATOR) !== false) {
|
|
254
|
-
$
|
|
255
|
-
foreach ($originalRoutes as $originalRoute) {
|
|
256
|
-
if (preg_match('~^\\.\\/src\\/app[\\/\\\\]\\(.*?\\)[\\/\\\\].*?\\.php$~', $originalRoute, $matches)) {
|
|
257
|
-
$directGroupMatchFound = true;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
if ($directGroupMatchFound) continue;
|
|
254
|
+
if ($basename !== 'route.php' && $basename !== 'index.php') continue;
|
|
262
255
|
|
|
263
256
|
$errorMessages[] = "Duplicate route found after normalization: " . $normalizedRoute;
|
|
264
257
|
|
|
@@ -72,7 +72,7 @@ class AuthMiddleware
|
|
|
72
72
|
$roleBasedRoutes = AuthConfig::$roleBasedRoutes ?? [];
|
|
73
73
|
foreach ($roleBasedRoutes as $pattern => $data) {
|
|
74
74
|
if (self::getUriRegex($pattern, $requestUri)) {
|
|
75
|
-
$userRole = $auth->getPayload()
|
|
75
|
+
$userRole = Auth::ROLE_NAME ? $auth->getPayload()[Auth::ROLE_NAME] : $auth->getPayload();
|
|
76
76
|
if ($userRole !== null && AuthConfig::checkAuthRole($userRole, $data[AuthConfig::ROLE_IDENTIFIER])) {
|
|
77
77
|
return true;
|
|
78
78
|
}
|