@artatol-acp/auth-nextjs 0.6.2 → 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.
- package/dist/middleware.js +2 -2
- package/dist/proxy.js +2 -2
- package/dist/server/index.js +2 -2
- package/package.json +2 -2
package/dist/middleware.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, '
|
|
64
|
+
publicKey = await importSPKI(jwtPublicKey, 'RS256');
|
|
65
65
|
}
|
|
66
66
|
await jwtVerify(accessToken, publicKey, {
|
|
67
|
-
algorithms: ['
|
|
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, '
|
|
64
|
+
publicKey = await importSPKI(jwtPublicKey, 'RS256');
|
|
65
65
|
}
|
|
66
66
|
await jwtVerify(accessToken, publicKey, {
|
|
67
|
-
algorithms: ['
|
|
67
|
+
algorithms: ['RS256'],
|
|
68
68
|
});
|
|
69
69
|
return NextResponse.next();
|
|
70
70
|
}
|
package/dist/server/index.js
CHANGED
|
@@ -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, '
|
|
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: ['
|
|
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
|
+
"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
|
+
}
|