Skip to content

Commit

Permalink
omit code_challenge if using privateclient
Browse files Browse the repository at this point in the history
  • Loading branch information
yunakim714 committed Sep 16, 2024
1 parent 31dd0a6 commit 6eb9175
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/static/helpers/slasHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export async function authorize(
redirectURI: string;
hint?: string;
usid?: string;
}
},
privateClient = false
): Promise<{code: string; url: string; usid: string}> {
const codeChallenge = await generateCodeChallenge(codeVerifier);

Expand All @@ -134,7 +135,7 @@ export async function authorize(
parameters: {
client_id: slasClient.clientConfig.parameters.clientId,
channel_id: slasClient.clientConfig.parameters.siteId,
code_challenge: codeChallenge,
...(!privateClient && {code_challenge: codeChallenge}),
...(parameters.hint && {hint: parameters.hint}),
organizationId: slasClient.clientConfig.parameters.organizationId,
redirect_uri: parameters.redirectURI,
Expand Down

0 comments on commit 6eb9175

Please sign in to comment.