create-prisma-php-app 1.27.1 → 1.27.2

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.
@@ -18,6 +18,15 @@ final class AuthMiddleware
18
18
  $isPublicRoute = self::matches($requestPathname, AuthConfig::$publicRoutes);
19
19
  $isAuthRoute = self::matches($requestPathname, AuthConfig::$authRoutes);
20
20
 
21
+ // Check if the user is authenticated and refresh the token if necessary
22
+ if (AuthConfig::IS_TOKEN_AUTO_REFRESH) {
23
+ $auth = Auth::getInstance();
24
+ if (isset($_COOKIE[Auth::COOKIE_NAME])) {
25
+ $jwt = $_COOKIE[Auth::COOKIE_NAME];
26
+ $jwt = $auth->refreshToken($jwt);
27
+ }
28
+ }
29
+
21
30
  // Skip the middleware if the route is api auth route
22
31
  if ($isApiAuthRoute) {
23
32
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.27.1",
3
+ "version": "1.27.2",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",