Skip to content

Commit

Permalink
Don't report fatal error if there are no tokens for the provider duri…
Browse files Browse the repository at this point in the history
…ng token revocation (#1407)

This should just be a noop
  • Loading branch information
jhrozek authored Nov 2, 2023
1 parent a449e5b commit 13cbf4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/controlplane/handlers_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"fmt"

"github.com/google/uuid"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
Expand Down Expand Up @@ -296,7 +297,10 @@ func (s *Server) RevokeOauthTokens(ctx context.Context, _ *pb.RevokeOauthTokensR
provider := providers[idx]
// need to read all tokens from the provider and revoke them
tokens, err := s.store.GetAccessTokenByProvider(ctx, provider.Name)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
zerolog.Ctx(ctx).Info().Str("provider", provider.Name).Msgf("no tokens found, skipping")
continue
} else if err != nil {
return nil, status.Errorf(codes.Internal, "error getting access tokens: %v", err)
}

Expand Down

0 comments on commit 13cbf4d

Please sign in to comment.