File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,15 @@ export class DigmaApiClient {
3939 }
4040
4141 private isAuthenticationRequired ( url : string ) : boolean {
42- return this . authEndpoints . some ( ( endpoint ) => url . endsWith ( endpoint ) ) ;
42+ return this . authEndpoints . some ( ( endpoint ) => ! url . endsWith ( endpoint ) ) ;
4343 }
4444
4545 private setupInterceptors ( ) : void {
4646 // Request interceptor to check token expiry
4747 this . instance . interceptors . request . use (
4848 async ( config ) => {
4949 // Skip token check for authentication endpoints
50- if ( config . url && this . isAuthenticationRequired ( config . url ) ) {
50+ if ( config . url && ! this . isAuthenticationRequired ( config . url ) ) {
5151 return config ;
5252 }
5353
@@ -76,7 +76,7 @@ export class DigmaApiClient {
7676 // Skip retry for authentication endpoints to avoid loops
7777 if (
7878 originalRequest ?. url &&
79- this . isAuthenticationRequired ( originalRequest . url )
79+ ! this . isAuthenticationRequired ( originalRequest . url )
8080 ) {
8181 return Promise . reject ( error ) ;
8282 }
@@ -114,7 +114,7 @@ export class DigmaApiClient {
114114
115115 private isTokenExpired ( session : UserSession ) : boolean {
116116 const expiration = new Date ( session . expiration ) . valueOf ( ) ;
117- return expiration < Date . now ( ) ;
117+ return expiration <= Date . now ( ) ;
118118 }
119119
120120 private async handleTokenRefresh ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments