@@ -189,18 +189,6 @@ export class BackendSrv implements BackendService {
189
189
return lastValueFrom ( this . fetch < T > ( options ) ) ;
190
190
}
191
191
192
- private getCodeRabbitOrg ( ) : { id : string } | null {
193
- const selectedOrgStorage = sessionStorage . getItem ( 'selected_org' ) ;
194
-
195
- try {
196
- return selectedOrgStorage ? ( JSON . parse ( selectedOrgStorage ) as { id : string } ) : null ;
197
- } catch ( e ) {
198
- console . error ( 'Failed to parse selected_org' , selectedOrgStorage , 'error:' , e ) ;
199
- sessionStorage . removeItem ( 'selected_org' ) ;
200
- return null ;
201
- }
202
- }
203
-
204
192
private parseRequestOptions ( options : BackendSrvRequest ) : BackendSrvRequest {
205
193
const orgId = this . dependencies . contextSrv . user ?. orgId ;
206
194
@@ -213,26 +201,10 @@ export class BackendSrv implements BackendService {
213
201
options . headers [ 'X-Grafana-Org-Id' ] = orgId ;
214
202
}
215
203
216
- const codeRabbitOrg = this . getCodeRabbitOrg ( ) ;
217
- if ( codeRabbitOrg ) {
218
- options . headers = options . headers ?? { } ;
219
- options . headers [ 'x-coderabbit-organization' ] = codeRabbitOrg . id ;
220
- const firebaseTenantId = sessionStorage . getItem ( 'firebaseTenantId' ) ;
221
- if ( firebaseTenantId ) {
222
- options . headers [ 'x-tenant-id' ] = firebaseTenantId ;
223
- }
224
- }
225
-
226
204
if ( options . url . startsWith ( '/' ) ) {
227
205
options . url = options . url . substring ( 1 ) ;
228
206
}
229
207
230
- const codeRabbitToken = sessionStorage . getItem ( 'accessToken' ) ;
231
- if ( codeRabbitToken ) {
232
- options . headers = options . headers ?? { } ;
233
- options . headers [ 'x-coderabbit-token' ] = `Bearer ${ codeRabbitToken } ` ;
234
- }
235
-
236
208
if ( options . headers ?. Authorization ) {
237
209
options . headers [ 'X-DS-Authorization' ] = options . headers . Authorization ;
238
210
delete options . headers . Authorization ;
0 commit comments