We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b045ac commit 14dc99fCopy full SHA for 14dc99f
src/lib/seam/connect/auth.ts
@@ -56,6 +56,18 @@ const getAuthHeadersForApiKey = ({
56
const getAuthHeadersForClientSessionToken = ({
57
clientSessionToken,
58
}: SeamHttpOptionsWithClientSessionToken): Headers => {
59
+ if (isJwt(clientSessionToken)) {
60
+ throw new SeamHttpInvalidTokenError(
61
+ 'A JWT cannot be used as a clientSessionToken',
62
+ )
63
+ }
64
+
65
+ if (isAccessToken(clientSessionToken)) {
66
67
+ 'An Access Token cannot be used as a clientSessionToken',
68
69
70
71
if (!isClientSessionToken(clientSessionToken)) {
72
throw new SeamHttpInvalidTokenError(
73
`Unknown or invalid clientSessionToken format, expected token to start with ${clientSessionTokenPrefix}`,
0 commit comments