@@ -31,7 +31,7 @@ export const Auth = (() => {
3131 }
3232
3333 function getCookie ( name ) {
34- const nameEQ = name + "=" ;
34+ const nameEQ = ` ${ name } =` ;
3535 const ca = document . cookie . split ( ";" ) ;
3636 for ( let i = 0 ; i < ca . length ; i ++ ) {
3737 let c = ca [ i ] ;
@@ -79,7 +79,7 @@ export const Auth = (() => {
7979 console . log ( "[Auth.initiateOAuthLogin] Current URL:" , window . location . href ) ;
8080 console . log (
8181 "[Auth.initiateOAuthLogin] Redirecting to:" ,
82- window . location . origin + " /oauth/login"
82+ ` ${ window . location . origin } /oauth/login`
8383 ) ;
8484
8585 // Simply redirect to the backend OAuth endpoint
@@ -198,7 +198,7 @@ export const Auth = (() => {
198198 errorDiv . style . display = "block" ;
199199 }
200200 }
201- } catch ( error ) {
201+ } catch ( _error ) {
202202 if ( errorDiv ) {
203203 errorDiv . textContent = "Error validating token. Please try again." ;
204204 errorDiv . style . display = "block" ;
@@ -274,7 +274,7 @@ export const Auth = (() => {
274274
275275 const token = getStoredToken ( ) ;
276276 if ( token ) {
277- headers [ " Authorization" ] = `token ${ token } ` ;
277+ headers . Authorization = `token ${ token } ` ;
278278 }
279279
280280 let lastError ;
@@ -302,14 +302,14 @@ export const Auth = (() => {
302302 const responseClone = response . clone ( ) ;
303303 const responseText = await responseClone . text ( ) ;
304304 console . warn ( "Response body:" , responseText ) ;
305- } catch ( e ) {
305+ } catch ( _e ) {
306306 console . warn ( "Could not read response body due to CORS restrictions" ) ;
307307 }
308308 }
309309
310310 // Retry on all 500+ server errors
311311 if ( response . status >= 500 && attempt < retries ) {
312- const delay = Math . min ( 250 * Math . pow ( 2 , attempt ) , 10000 ) ; // Exponential backoff starting at 250ms, max 10s
312+ const delay = Math . min ( 250 * 2 ** attempt , 10000 ) ; // Exponential backoff starting at 250ms, max 10s
313313 console . warn (
314314 `[githubAPI] Retry ${ attempt + 1 } /${ retries } for ${ CONFIG . API_BASE } ${ endpoint } - Status: ${ response . status } , Delay: ${ delay } ms`
315315 ) ;
@@ -325,7 +325,7 @@ export const Auth = (() => {
325325
326326 // If it's a network error and we have retries left, try again
327327 if ( attempt < retries ) {
328- const delay = Math . min ( 250 * Math . pow ( 2 , attempt ) , 10000 ) ;
328+ const delay = Math . min ( 250 * 2 ** attempt , 10000 ) ;
329329 console . warn (
330330 `[githubAPI] Network error retry ${ attempt + 1 } /${ retries } for ${ CONFIG . API_BASE } ${ endpoint } - Error: ${ error . message } , Delay: ${ delay } ms`
331331 ) ;
@@ -385,7 +385,7 @@ export const Auth = (() => {
385385
386386 // Retry on all 500+ server errors
387387 if ( response . status >= 500 && attempt < retries ) {
388- const delay = Math . min ( 250 * Math . pow ( 2 , attempt ) , 10000 ) ; // Exponential backoff starting at 250ms, max 10s
388+ const delay = Math . min ( 250 * 2 ** attempt , 10000 ) ; // Exponential backoff starting at 250ms, max 10s
389389
390390 // Log all available response information
391391 console . warn (
@@ -397,7 +397,7 @@ export const Auth = (() => {
397397 try {
398398 const responseText = await response . text ( ) ;
399399 console . warn ( "Response body:" , responseText ) ;
400- } catch ( e ) {
400+ } catch ( _e ) {
401401 console . warn ( "Could not read response body due to CORS restrictions" ) ;
402402 }
403403
@@ -410,15 +410,15 @@ export const Auth = (() => {
410410 console . error ( "Request details:" , {
411411 query,
412412 variables,
413- authHeader : authHeader . substring ( 0 , 20 ) + " ..." ,
413+ authHeader : ` ${ authHeader . substring ( 0 , 20 ) } ...` ,
414414 } ) ;
415415 throw new Error ( `GraphQL request failed: ${ response . status } ${ response . statusText } ` ) ;
416416 }
417417
418418 const data = await response . json ( ) ;
419419 if ( data . errors ) {
420420 console . error ( "GraphQL errors:" , data . errors ) ;
421- throw new Error ( " GraphQL query failed: " + data . errors [ 0 ] ?. message ) ;
421+ throw new Error ( ` GraphQL query failed: ${ data . errors [ 0 ] ?. message } ` ) ;
422422 }
423423
424424 return data . data ;
@@ -427,7 +427,7 @@ export const Auth = (() => {
427427
428428 // If it's a network error and we have retries left, try again
429429 if ( error . name === "TypeError" && error . message . includes ( "fetch" ) && attempt < retries ) {
430- const delay = Math . min ( 250 * Math . pow ( 2 , attempt ) , 10000 ) ;
430+ const delay = Math . min ( 250 * 2 ** attempt , 10000 ) ;
431431 console . warn (
432432 `[githubGraphQL] Network error retry ${ attempt + 1 } /${ retries } for ${ CONFIG . API_BASE } /graphql - Error: ${ error . message } , Delay: ${ delay } ms`
433433 ) ;
0 commit comments