@@ -189,18 +189,6 @@ export class BackendSrv implements BackendService {
189189 return lastValueFrom ( this . fetch < T > ( options ) ) ;
190190 }
191191
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-
204192 private parseRequestOptions ( options : BackendSrvRequest ) : BackendSrvRequest {
205193 const orgId = this . dependencies . contextSrv . user ?. orgId ;
206194
@@ -213,26 +201,10 @@ export class BackendSrv implements BackendService {
213201 options . headers [ 'X-Grafana-Org-Id' ] = orgId ;
214202 }
215203
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-
226204 if ( options . url . startsWith ( '/' ) ) {
227205 options . url = options . url . substring ( 1 ) ;
228206 }
229207
230- const codeRabbitToken = sessionStorage . getItem ( 'accessToken' ) ;
231- if ( codeRabbitToken ) {
232- options . headers = options . headers ?? { } ;
233- options . headers [ 'x-coderabbit-token' ] = `Bearer ${ codeRabbitToken } ` ;
234- }
235-
236208 if ( options . headers ?. Authorization ) {
237209 options . headers [ 'X-DS-Authorization' ] = options . headers . Authorization ;
238210 delete options . headers . Authorization ;
0 commit comments