Skip to content

Commit

Permalink
If we are unable to determine if the user has agreed to the provider …
Browse files Browse the repository at this point in the history
…ToS, return false
  • Loading branch information
rubys committed Jan 7, 2025
1 parent 6ad4018 commit ef100e2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/command/extensions/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,14 @@ func AgreedToProviderTos(ctx context.Context, providerName string) (bool, error)
if err != nil {
return false, err
}
return tosResp.Viewer.(*gql.AgreedToProviderTosViewerUser).AgreedToProviderTos, nil

viewerUser, ok := tosResp.Viewer.(*gql.AgreedToProviderTosViewerUser)
if ok {
return viewerUser.AgreedToProviderTos, nil
} else {
// If we are unable to determine if the user has agreed to the provider ToS, return false
return false, nil
}
}

func Status(ctx context.Context, provider gql.AddOnType) (err error) {
Expand Down

0 comments on commit ef100e2

Please sign in to comment.