Skip to content

Commit

Permalink
fix: encode query params for react native compat
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Nov 17, 2024
1 parent 0bcd792 commit 10564bf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/oauth2/src/Oauth2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class Oauth2Client {
request_uri: error.errorResponse.request_uri,
client_id: options.clientId,
}
)}`
).toString()}`

return {
authorizationRequestUrl,
Expand Down
2 changes: 1 addition & 1 deletion packages/oauth2/src/access-token/introspect-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export async function introspectToken(options: IntrospectTokenOptions) {
ContentType.Json,
introspectionEndpoint,
{
body: objectToQueryParams(introspectionRequest),
body: objectToQueryParams(introspectionRequest).toString(),
method: 'POST',
headers,
}
Expand Down
2 changes: 1 addition & 1 deletion packages/oauth2/src/access-token/retrieve-access-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ async function retrieveAccessToken(options: RetrieveAccessTokenOptions): Promise
ContentType.Json,
options.authorizationServerMetadata.token_endpoint,
{
body: requestQueryParams,
body: requestQueryParams.toString(),
method: 'POST',
headers: {
'Content-Type': ContentType.XWwwFormUrlencoded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export async function sendAuthorizationChallengeRequest(options: SendAuthorizati
authorizationServerMetadata.authorization_challenge_endpoint,
{
method: 'POST',
body: objectToQueryParams(authorizationChallengeRequest),
body: objectToQueryParams(authorizationChallengeRequest).toString(),
headers: {
'Content-Type': ContentType.XWwwFormUrlencoded,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export async function createAuthorizationRequestUrl(options: CreateAuthorization
}
}

const authorizationRequestUrl = `${authorizationServerMetadata.authorization_endpoint}?${objectToQueryParams(pushedAuthorizationRequest ?? authorizationRequest)}`
const authorizationRequestUrl = `${authorizationServerMetadata.authorization_endpoint}?${objectToQueryParams(pushedAuthorizationRequest ?? authorizationRequest).toString()}`
return {
authorizationRequestUrl,
pkce,
Expand Down Expand Up @@ -150,7 +150,7 @@ async function pushAuthorizationRequest(options: PushAuthorizationRequestOptions
options.pushedAuthorizationRequestEndpoint,
{
method: 'POST',
body: objectToQueryParams(options.authorizationRequest),
body: objectToQueryParams(options.authorizationRequest).toString(),
headers: {
'Content-Type': ContentType.XWwwFormUrlencoded,
},
Expand Down

0 comments on commit 10564bf

Please sign in to comment.