Skip to content

Commit

Permalink
Trying another current url approach
Browse files Browse the repository at this point in the history
in authorization grant requestt
  • Loading branch information
spaceo committed Nov 17, 2024
1 parent e0b52b3 commit 8d610f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/auth/callback/unilogin/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ export interface TIntrospectionResponse extends client.IntrospectionResponse {
export async function GET(request: NextRequest) {
const session = await getSession()
const config = await getUniloginClientConfig()
const currentUrl = new URL(request.nextUrl.href)

// eslint-disable-next-line no-console
console.log("currentUrl URL: ", currentUrl)
// Fetch all user/token info.
try {
const tokenSetResponse = await client.authorizationCodeGrant(config, request, {
const tokenSetResponse = await client.authorizationCodeGrant(config, currentUrl, {
pkceCodeVerifier: session.code_verifier,
idTokenExpected: true,
})
Expand Down

0 comments on commit 8d610f7

Please sign in to comment.