Commit cc11e3e 1 parent 8513353 commit cc11e3e Copy full SHA for cc11e3e
File tree 1 file changed +9
-1
lines changed
templates/vue/vue3-ai-chatbot-widget/src/core
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,10 @@ export class AzionCopilot {
175
175
headers [ 'Authorization' ] = `Bearer ${ this . authToken } `
176
176
}
177
177
178
+ if ( this . authMode === 'clerk' ) {
179
+ headers [ 'Authorization' ] = `Bearer ${ document . cookie . split ( '__session=' ) [ 1 ] ?. split ( ';' ) [ 0 ] } `
180
+ }
181
+
178
182
const response = await fetch ( `${ this . serverConfig . url } ${ this . serverConfig . conversation } ` , {
179
183
method : 'POST' ,
180
184
credentials : shouldIncludeCredentials ? 'include' : 'omit' ,
@@ -285,6 +289,10 @@ export class AzionCopilot {
285
289
headers [ 'Authorization' ] = `Bearer ${ this . authToken } `
286
290
}
287
291
292
+ if ( this . authMode === 'clerk' ) {
293
+ headers [ 'Authorization' ] = `Bearer ${ document . cookie . split ( '__session=' ) [ 1 ] ?. split ( ';' ) [ 0 ] } `
294
+ }
295
+
288
296
const response = await fetch ( `${ this . serverConfig . url } ${ this . serverConfig . feedback } ` , {
289
297
method : 'POST' ,
290
298
credentials : shouldIncludeCredentials ? 'include' : 'omit' ,
@@ -370,4 +378,4 @@ export class AzionCopilot {
370
378
setAuthToken ( token ) {
371
379
this . authToken = token
372
380
}
373
- }
381
+ }
You can’t perform that action at this time.
0 commit comments