fix: do not rewrite when there are no keys

This commit is contained in:
Maxim Slipenko 2024-12-10 14:01:02 +00:00
parent 47fd9a421f
commit a87e0d0e46

View file

@ -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 {