diff --git a/services/auth/source/oauth2/source_sync.go b/services/auth/source/oauth2/source_sync.go index b0b08d1a50..59590a8bb3 100644 --- a/services/auth/source/oauth2/source_sync.go +++ b/services/auth/source/oauth2/source_sync.go @@ -169,6 +169,10 @@ func updateSSHKeys( return err } + if len(sshKeys) == 0 { + return nil + } + if asymkey_model.SynchronizePublicKeys(ctx, user, source.authSource, sshKeys) { err = asymkey_model.RewriteAllPublicKeys(ctx) if err != nil {