I’m trying to use an access token generated by the getAccessToken function but for some reason its returning a jwt without a payload
Here’s my handler code
// app/api/auth/[auth0]/route.js
import { handleAuth, handleLogin } from '@auth0/nextjs-auth0';
export const GET = handleAuth({
login: handleLogin({
authorizationParams: {
audience: 'https://anonymized.us.auth0.com/userinfo', // or AUTH0_AUDIENCE
// Add the `offline_access` scope to also get a Refresh Token
scope: 'openid profile email offline_access read:products' // or AUTH0_SCOPE
}
})
});
And heres where I want to consume it
import { getAccessToken, getSession } from '@auth0/nextjs-auth0';
export async function POST(req) {
const { accessToken } = await getAccessToken({
scopes: ["offline_access"]
});=
const options = {
headers: { Authorization: `Bearer ${accessToken}` },
method: "POST"
}
const url = `${process.env.LMS_URL}/login_refresh`
let loginResponse = await fetch(url, options)
return loginResponse
}
For some reason the jwt has no payload, I also made sure that I was passing the audience when logging in
sorry for the tags, I can’t seem to find the proper tags for the help board
