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 {
64
64
return undefined ;
65
65
}
66
66
if ( await apiClient . validateToken ( ) ) {
67
- request . headers . set ( "Authorization" , `Bearer ${ apiClient . token ? .access_token } ` ) ;
67
+ request . headers . set ( "Authorization" , `Bearer ${ apiClient . token ! . access_token } ` ) ;
68
68
return request ;
69
69
}
70
70
} ,
@@ -253,15 +253,17 @@ export class ApiClient {
253
253
}
254
254
255
255
async getIpInfo ( ) {
256
- await this . validateToken ( ) ;
256
+ if ( ! ( await this . validateToken ( ) ) ) {
257
+ throw new Error ( "Not Authenticated" ) ;
258
+ }
257
259
258
260
const endpoint = "api/private/ipinfo" ;
259
261
const url = new URL ( endpoint , config . apiBaseUrl ) ;
260
262
const response = await fetch ( url , {
261
263
method : "GET" ,
262
264
headers : {
263
265
Accept : "application/json" ,
264
- Authorization : `Bearer ${ this . token ? .access_token } ` ,
266
+ Authorization : `Bearer ${ this . token ! . access_token } ` ,
265
267
"User-Agent" : config . userAgent ,
266
268
} ,
267
269
} ) ;
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export class CreateAccessListTool extends AtlasToolBase {
39
39
} ) ) ;
40
40
41
41
if ( currentIpAddress ) {
42
- const currentIp = await this . apiClient ! . getIpInfo ( ) ;
42
+ const currentIp = await this . apiClient . getIpInfo ( ) ;
43
43
const input = {
44
44
groupId : projectId ,
45
45
ipAddress : currentIp . currentIpv4Address ,
You can’t perform that action at this time.
0 commit comments