File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ class HttpService {
7575 private setupInterceptors ( ) {
7676 // Request interceptor
7777 this . instance . interceptors . request . use (
78- ( config : InternalAxiosRequestConfig ) => {
78+ async ( config : InternalAxiosRequestConfig ) => {
7979 // Add auth token
8080 const token = wsCache . get ( 'user.token' )
8181 if ( token && config . headers ) {
@@ -90,6 +90,9 @@ class HttpService {
9090 ! ! ( assistantStore . getType % 2 ) &&
9191 assistantStore . getCertificate
9292 ) {
93+ if ( config . method ?. toLowerCase ( ) === 'get' && / \/ c h a t \/ \d + $ / . test ( config . url || '' ) ) {
94+ await assistantStore . refreshCertificate ( )
95+ }
9396 config . headers [ 'X-SQLBOT-ASSISTANT-CERTIFICATE' ] = btoa (
9497 encodeURIComponent ( assistantStore . getCertificate )
9598 )
You can’t perform that action at this time.
0 commit comments