mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-23 10:09:03 +02:00
fix: PAR parameters not respected by authorize page
This commit is contained in:
@@ -3,20 +3,24 @@ import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ url }) => {
|
||||
const clientId = url.searchParams.get('client_id');
|
||||
const requestURI = url.searchParams.get('request_uri') || undefined;
|
||||
const oidcService = new OidcService();
|
||||
|
||||
const client = await oidcService.getClientMetaData(clientId!);
|
||||
const [client, parInfo] = await Promise.all([
|
||||
oidcService.getClientMetaData(clientId!),
|
||||
requestURI ? oidcService.getParRequestInfo(clientId!, requestURI) : undefined
|
||||
]);
|
||||
|
||||
return {
|
||||
scope: url.searchParams.get('scope')!,
|
||||
nonce: url.searchParams.get('nonce') || undefined,
|
||||
authorizeState: url.searchParams.get('state')!,
|
||||
callbackURL: url.searchParams.get('redirect_uri')!,
|
||||
scope: parInfo?.scope ?? url.searchParams.get('scope')!,
|
||||
nonce: parInfo?.nonce ?? url.searchParams.get('nonce') ?? undefined,
|
||||
authorizeState: parInfo?.state ?? url.searchParams.get('state')!,
|
||||
callbackURL: parInfo?.redirectURI ?? url.searchParams.get('redirect_uri')!,
|
||||
client,
|
||||
codeChallenge: url.searchParams.get('code_challenge')!,
|
||||
codeChallengeMethod: url.searchParams.get('code_challenge_method')!,
|
||||
prompt: url.searchParams.get('prompt') || undefined,
|
||||
responseMode: url.searchParams.get('response_mode') || undefined,
|
||||
requestURI: url.searchParams.get('request_uri') || undefined
|
||||
prompt: parInfo?.prompt ?? url.searchParams.get('prompt') ?? undefined,
|
||||
responseMode: parInfo?.responseMode ?? url.searchParams.get('response_mode') ?? undefined,
|
||||
requestURI
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user