Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit ee0fa03

Browse files
authored
fix: Do not send authorization header with client session token
1 parent 62dbfb9 commit ee0fa03

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

docs/classes/Seam.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/seam-connect/client.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export class Seam extends Routes {
9393
] = `Javascript SDK v${version}, Node.js mode, (https://github.com/seamapi/javascript)`
9494
}
9595
this.client = axios.create({
96-
withCredentials: clientSessionToken ? true : false,
9796
...axiosOptions,
9897
baseURL: endpoint,
9998
headers,
@@ -217,15 +216,15 @@ const getAuthHeaders = ({
217216
if (!clientSessionToken.startsWith("seam_cst")) {
218217
throw new Error("clientSessionToken must start with seam_cst")
219218
}
220-
return {
221-
authorization: `Bearer ${clientSessionToken}`,
222-
"client-session-token": clientSessionToken,
223-
}
219+
return { "client-session-token": clientSessionToken }
224220
}
225221

226222
if (apiKey) {
227223
if (apiKey.startsWith("seam_cst")) {
228-
throw new Error("You can't use a Client Session Token as an apiKey.")
224+
console.warn(
225+
"Using API Key as Client Session Token is deprecated. Please use the clientSessionToken option instead."
226+
)
227+
return { "client-session-token": apiKey }
229228
}
230229
if (!isValueUsedForBearerAuthentication(apiKey) && workspaceId)
231230
throw new Error(

0 commit comments

Comments
 (0)