File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export class ApiClient {
6464 return undefined ;
6565 }
6666 if ( await apiClient . validateToken ( ) ) {
67- request . headers . set ( "Authorization" , `Bearer ${ apiClient . token ? .access_token } ` ) ;
67+ request . headers . set ( "Authorization" , `Bearer ${ apiClient . token ! . access_token } ` ) ;
6868 return request ;
6969 }
7070 } ,
@@ -253,15 +253,17 @@ export class ApiClient {
253253 }
254254
255255 async getIpInfo ( ) {
256- await this . validateToken ( ) ;
256+ if ( ! ( await this . validateToken ( ) ) ) {
257+ throw new Error ( "Not Authenticated" ) ;
258+ }
257259
258260 const endpoint = "api/private/ipinfo" ;
259261 const url = new URL ( endpoint , config . apiBaseUrl ) ;
260262 const response = await fetch ( url , {
261263 method : "GET" ,
262264 headers : {
263265 Accept : "application/json" ,
264- Authorization : `Bearer ${ this . token ? .access_token } ` ,
266+ Authorization : `Bearer ${ this . token ! . access_token } ` ,
265267 "User-Agent" : config . userAgent ,
266268 } ,
267269 } ) ;
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export class CreateAccessListTool extends AtlasToolBase {
3939 } ) ) ;
4040
4141 if ( currentIpAddress ) {
42- const currentIp = await this . apiClient ! . getIpInfo ( ) ;
42+ const currentIp = await this . apiClient . getIpInfo ( ) ;
4343 const input = {
4444 groupId : projectId ,
4545 ipAddress : currentIp . currentIpv4Address ,
You can’t perform that action at this time.
0 commit comments