I see in the callback method the access token is available but I need it in the protected method.
{
path: "/protected",
async handler(req) {
const sessionId = await getSessionId(req);
if (!sessionId)
return new Response("Unauthenticated", { status: 401 })
// How can I get the access token?
// - need to do authz
// - need to use the token to call the api
},
},
I see in the callback method the access token is available but I need it in the protected method.