add interface
This commit is contained in:
32
id.saladeaula.digital/client/app/routes/authorize.tsx
Normal file
32
id.saladeaula.digital/client/app/routes/authorize.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
// import { parse } from 'cookie'
|
||||
|
||||
import type { Route } from './+types/authorize'
|
||||
|
||||
export async function loader({ request, context }: Route.LoaderArgs) {
|
||||
const url = new URL(request.url)
|
||||
const issuerUrl = new URL('/authorize', context.cloudflare.env.ISSUER_URL)
|
||||
issuerUrl.search = url.search
|
||||
|
||||
console.log(request.headers.get('Cookie'))
|
||||
|
||||
console.log(issuerUrl.toString())
|
||||
|
||||
try {
|
||||
const r = await fetch(issuerUrl.toString(), {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Cookie: request.headers.get('Cookie')
|
||||
}
|
||||
})
|
||||
|
||||
console.log(r)
|
||||
|
||||
// return new Response(await r.text(), {
|
||||
// status: r.status,
|
||||
// headers: r.headers
|
||||
// })
|
||||
} catch {
|
||||
return new Response(null, { status: 500 })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user