File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,10 +20,6 @@ export class CreateTokenTool extends MapboxApiBasedTool<
2020 input : CreateTokenInput ,
2121 accessToken ?: string
2222 ) : Promise < { type : 'text' ; text : string } > {
23- if ( ! accessToken ) {
24- throw new Error ( 'MAPBOX_ACCESS_TOKEN is not set' ) ;
25- }
26-
2723 const username = MapboxApiBasedTool . getUserNameFromToken ( accessToken ) ;
2824
2925 this . log (
Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ export class PreviewStyleTool extends MapboxApiBasedTool<
1717 }
1818
1919 protected async execute (
20- input : PreviewStyleInput
20+ input : PreviewStyleInput ,
21+ accessToken ?: string
2122 ) : Promise < { type : 'text' ; text : string } > {
22- const username = MapboxApiBasedTool . getUserNameFromToken ( ) ;
23+ const username = MapboxApiBasedTool . getUserNameFromToken ( accessToken ) ;
2324
2425 // Get list of tokens to find a public token
2526 const listTokensTool = new ListTokensTool ( ) ;
You can’t perform that action at this time.
0 commit comments