@thinkingcat/auth-utils 1.0.17 → 1.0.18

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JWT } from "next-auth/jwt";
1
+ import type { JWT } from "next-auth/jwt";
2
2
  import type { Session } from "next-auth";
3
3
  import { NextResponse, NextRequest } from 'next/server';
4
4
  export interface ResponseLike {
package/dist/index.js CHANGED
@@ -71,7 +71,6 @@ exports.checkAuthentication = checkAuthentication;
71
71
  exports.verifyAndRefreshTokenWithNextAuth = verifyAndRefreshTokenWithNextAuth;
72
72
  exports.createMiddlewareConfig = createMiddlewareConfig;
73
73
  exports.handleMiddleware = handleMiddleware;
74
- const jwt_1 = require("next-auth/jwt");
75
74
  const jose_1 = require("jose");
76
75
  const server_1 = require("next/server");
77
76
  // ============================================================================
@@ -208,8 +207,9 @@ function createNextAuthJWT(payload, serviceId) {
208
207
  */
209
208
  async function encodeNextAuthToken(jwt, secret, maxAge = 30 * 24 * 60 * 60) {
210
209
  try {
211
- // next-auth/jwt의 encode 함수 사용 (Node.js 런타임에서만 작동)
212
- return await (0, jwt_1.encode)({
210
+ // next-auth/jwt의 encode 함수를 동적 import로 사용 (Edge Runtime 호환)
211
+ const { encode } = await Promise.resolve().then(() => __importStar(require('next-auth/jwt')));
212
+ return await encode({
213
213
  token: jwt,
214
214
  secret: secret,
215
215
  maxAge: maxAge,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkingcat/auth-utils",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Authentication utilities for ThinkingCat SSO services with conditional logging",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -40,6 +40,3 @@
40
40
  ".env.example"
41
41
  ]
42
42
  }
43
-
44
-
45
-