Skip to content

Commit

Permalink
add verify check (#3079)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrav committed Jul 20, 2024
1 parent 936095b commit 7a36e89
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/detectors/github_oauth2/github_oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
ClientSecret: secretMatch[1],
TokenURL: github.Endpoint.TokenURL,
}
_, err := config.Token(ctx)
if err != nil && strings.Contains(err.Error(), githubBadVerificationCodeError) {
s1.Verified = true
if verify {
_, err := config.Token(ctx)
if err != nil && strings.Contains(err.Error(), githubBadVerificationCodeError) {
s1.Verified = true
}
}

results = append(results, s1)
Expand Down

0 comments on commit 7a36e89

Please sign in to comment.