@artatol-acp/auth-nextjs 0.6.3 → 0.6.4

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.
@@ -61,10 +61,10 @@ export function createACPAuthMiddleware(options) {
61
61
  // Verify access token
62
62
  try {
63
63
  if (!publicKey) {
64
- publicKey = await importSPKI(jwtPublicKey, 'EdDSA');
64
+ publicKey = await importSPKI(jwtPublicKey, 'RS256');
65
65
  }
66
66
  await jwtVerify(accessToken, publicKey, {
67
- algorithms: ['EdDSA'],
67
+ algorithms: ['RS256'],
68
68
  });
69
69
  return NextResponse.next();
70
70
  }
package/dist/proxy.js CHANGED
@@ -61,10 +61,10 @@ export function createACPAuthMiddleware(options) {
61
61
  // Verify access token
62
62
  try {
63
63
  if (!publicKey) {
64
- publicKey = await importSPKI(jwtPublicKey, 'EdDSA');
64
+ publicKey = await importSPKI(jwtPublicKey, 'RS256');
65
65
  }
66
66
  await jwtVerify(accessToken, publicKey, {
67
- algorithms: ['EdDSA'],
67
+ algorithms: ['RS256'],
68
68
  });
69
69
  return NextResponse.next();
70
70
  }
@@ -24,7 +24,7 @@ function getCookieOptions() {
24
24
  async function getPublicKey() {
25
25
  const cfg = getConfig();
26
26
  if (!publicKey) {
27
- publicKey = await importSPKI(cfg.jwtPublicKey, 'EdDSA');
27
+ publicKey = await importSPKI(cfg.jwtPublicKey, 'RS256');
28
28
  }
29
29
  return publicKey;
30
30
  }
@@ -116,7 +116,7 @@ export async function verifyAccessToken(token) {
116
116
  const key = await getPublicKey();
117
117
  try {
118
118
  const { payload } = await jwtVerify(token, key, {
119
- algorithms: ['EdDSA'],
119
+ algorithms: ['RS256'],
120
120
  });
121
121
  return {
122
122
  id: payload.authUserId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artatol-acp/auth-nextjs",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Next.js SDK for Artatol Cloud Platform Authentication with support for App Router, Server Actions, and Middleware",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -63,4 +63,4 @@
63
63
  "dev": "tsc --watch",
64
64
  "typecheck": "tsc --noEmit"
65
65
  }
66
- }
66
+ }