Skip to content

Commit d6d4100

Browse files
committed
Fix auth response handling in REST API tool
1 parent 36287ea commit d6d4100

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tool/openapitoolset/rest_api_tool.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ func (t *RestApiTool) Run(ctx tool.Context, args any) (map[string]any, error) {
146146
}
147147

148148
// Check for existing credential from auth response
149-
authResponse := ctx.GetAuthResponse(authConfig)
149+
authResponse, err := ctx.GetAuthResponse(authConfig)
150+
if err != nil {
151+
return nil, fmt.Errorf("failed to fetch auth response: %w", err)
152+
}
150153
if authResponse != nil {
151154
// User has completed OAuth flow - use the credential
152155
t.authCredential = authResponse

0 commit comments

Comments
 (0)