Skip to content

Commit

Permalink
OIDC scope 타입 검증 수정 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
tirr-c authored Apr 8, 2024
1 parent 1cc2b13 commit dfe75b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const interactionDetailsSchema = z.object({
]),
params: z.object({
client_id: z.string().optional(),
scope: z.string().array().optional(),
scope: z.string().or(z.string().array()).optional(),
}),
client: oauthClientSchema.optional(),
});
Expand Down
5 changes: 4 additions & 1 deletion app/(nolocale)/oauth/[uid]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export default async function OAuthPage({
if (interactionDetails.prompt.name === 'consent') {
const details = interactionDetails.prompt.details;
const client = interactionDetails.client;
const grantedScope = interactionDetails.params.scope;
let grantedScope = interactionDetails.params.scope;
if (typeof grantedScope === 'string') {
grantedScope = grantedScope.split(' ').filter(x => Boolean(x));
}
return <OAuthConsent details={details} client={client} grantedScope={grantedScope} />;
}

Expand Down

0 comments on commit dfe75b0

Please sign in to comment.