create-prisma-php-app 1.11.12 → 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.
@@ -10,6 +10,7 @@ use DateTime;
10
10
  class Auth
11
11
  {
12
12
  public const PAYLOAD_NAME = 'role';
13
+ public const ROLE_NAME = '';
13
14
  public const PAYLOAD = 'payload';
14
15
  public const COOKIE_NAME = 'auth_token';
15
16
 
@@ -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() ?? null;
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.11.12",
3
+ "version": "1.11.13",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",