From a87e0d0e46724e7c5fd06bdfc4a7413bc098461c Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Tue, 10 Dec 2024 14:01:02 +0000 Subject: [PATCH] fix: do not rewrite when there are no keys --- services/auth/source/oauth2/source_sync.go | 4 ++++ 1 file changed, 4 insertions(+) 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 {