Skip to content

Commit

Permalink
chore(client): correct token location check in parseRequestToken
Browse files Browse the repository at this point in the history
Fixed a typo in the `parseRequestToken` function to ensure the correct handling of token placement in the request headers. The condition mistakenly checked for 'headers' instead of 'header', which could lead to incorrect or failed token handling in API requests. This fix aligns with the standard naming convention and ensures the function behaves as intended.
  • Loading branch information
shorwood committed Nov 29, 2024
1 parent 18662ed commit 0e76fb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/client/utils/parseRequestToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function parseRequestToken(context: Partial<RequestContext>, options: Fet
}

// --- Append the token to the path parameters.
else if (tokenLocation === 'headers') {
else if (tokenLocation === 'header') {
context.init = context.init ?? {}
context.init.headers = context.init.headers ?? {}
if (tokenProperty) setHeader(context.init.headers, tokenProperty, token)
Expand Down

0 comments on commit 0e76fb0

Please sign in to comment.