Fix a panic when management is behind an invalid proxy (#1930)

- Add a new error on gRPC client that doesn't pass the incorrect status from the gRPC client
- Try login only if we have a server public key
This commit is contained in:
Maycon Santos
2024-05-06 18:04:32 +02:00
committed by GitHub
parent 13b63eebc1
commit 7357a9954c
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ func Login(ctx context.Context, config *Config, setupKey string, jwtToken string
}
serverKey, err := doMgmLogin(ctx, mgmClient, pubSSHKey)
if isRegistrationNeeded(err) {
if serverKey != nil && isRegistrationNeeded(err) {
log.Debugf("peer registration required")
_, err = registerPeer(ctx, *serverKey, mgmClient, setupKey, jwtToken, pubSSHKey)
return err