You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using the edge runtime to run a next-on-pages application (next 14.2.5). I'm adding this issue here not because I have an expectation that the issue is fixed, just to bring attention to it.
On the server side I'm trying to validate the JWT in the authorization cookie in a route.ts API handler, and extract some information from it.
const token = request.cookies.get("authorization")?.value;
if (!token) {
console.error("No authorization token found in cookies.");
return new Response("Unauthorized", { status: 401 });
}
const authressClient = new AuthressClient({
authressApiUrl: "https://auth.somedomain.com",
});
const decoded = await authressClient.verifyToken(token);
I get an error
Import trace for requested module:
./node_modules/@authress/sdk/index.js
./app/api/a/route.ts
./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=[redacted]&page=%2Fapi%2Fa%2Froute&appDirLoader=[redacted]&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
⨯ ./node_modules/@authress/sdk/src/serviceClientTokenProvider.js:2:28
Module not found: Can't resolve 'crypto'
It looks like serviceClientTokenProvider.js:2:28 is
const { createPrivateKey } = require('crypto');
Not being able to resolve 'crypto' is I think normal for the edge runtime, as it does not include it. More information at cloudflare/next-on-pages#686
I am successfully using jose to retrieve the JWKS details and validating.
Happy to provide any other information.
The text was updated successfully, but these errors were encountered:
Hi, I'm using the edge runtime to run a next-on-pages application (next 14.2.5). I'm adding this issue here not because I have an expectation that the issue is fixed, just to bring attention to it.
On the server side I'm trying to validate the JWT in the
authorization
cookie in a route.ts API handler, and extract some information from it.I get an error
It looks like serviceClientTokenProvider.js:2:28 is
Not being able to resolve 'crypto' is I think normal for the edge runtime, as it does not include it. More information at cloudflare/next-on-pages#686
I am successfully using jose to retrieve the JWKS details and validating.
Happy to provide any other information.
The text was updated successfully, but these errors were encountered: