From cfda8047262f9aca8a0e23c4b8a02e0da0b25d20 Mon Sep 17 00:00:00 2001 From: kyra Date: Tue, 18 Oct 2022 17:56:00 +0800 Subject: [PATCH] Provide LoginName when registering with pre-auth key --- protocol_common.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/protocol_common.go b/protocol_common.go index fa9ccc4..e0d2c40 100644 --- a/protocol_common.go +++ b/protocol_common.go @@ -435,6 +435,10 @@ func (h *Headscale) handleAuthKeyCommon( resp.MachineAuthorized = true resp.User = *pak.Namespace.toUser() + // Provide LoginName when registering with pre-auth key + // Otherwise it will need to exec `tailscale up` twice to fetch the *LoginName* + resp.Login = *pak.Namespace.toLogin() + respBody, err := h.marshalResponse(resp, machineKey) if err != nil { log.Error().