Closed ra-kesh closed 1 year ago
Getting the below request timeout error while trying to verify using a public JSON Web Key Set with next js 13 app router middlware and hanko . It was working perfectly fine 2 days ago but suddenly it's giving timeout most of the time now
request timeout error
[JWKSTimeout: request timed out] { code: 'ERR_JWKS_TIMEOUT', name: 'JWKSTimeout', message: 'request timed out' }
4.15.3
Browser
Next 13.5.6
import { NextResponse, NextRequest } from "next/server"; import { jwtVerify, createRemoteJWKSet } from "jose"; const hankoApiUrl = process.env.NEXT_PUBLIC_HANKO_API_URL; export async function middleware(req: NextRequest) { const hanko = req.cookies.get("hanko")?.value; const JWKS = createRemoteJWKSet( new URL(`${hankoApiUrl}/.well-known/jwks.json`) ); try { const verifiedJWT = await jwtVerify(hanko ?? "", JWKS); } catch (error) { console.error(error) return NextResponse.redirect(new URL("/login", req.url)); } }
It was working perfectly fine 2 days ago but suddenly it's giving timeout most of the time now
That's something to take up with your Network, its settings, and/or the operator of the JSON Web Key Set service.
What happened?
Getting the below
request timeout error
while trying to verify using a public JSON Web Key Set with next js 13 app router middlware and hanko . It was working perfectly fine 2 days ago but suddenly it's giving timeout most of the time nowVersion
4.15.3
Runtime
Browser
Runtime Details
Next 13.5.6
Code to reproduce
Required