From 275cc28193b7be10a78cf4020d450130b5ac12e8 Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Tue, 15 Nov 2022 15:08:49 +0100 Subject: [PATCH] Do not strip nodekey prefix on handle expired --- protocol_common.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/protocol_common.go b/protocol_common.go index 201738fb..08bb349c 100644 --- a/protocol_common.go +++ b/protocol_common.go @@ -490,6 +490,7 @@ func (h *Headscale) handleNewMachineCommon( Bool("noise", machineKey.IsZero()). Str("machine", registerRequest.Hostinfo.Hostname). Msg("The node seems to be new, sending auth url") + if h.oauth2Config != nil { resp.AuthURL = fmt.Sprintf( "%s/oidc/register/%s", @@ -727,7 +728,7 @@ func (h *Headscale) handleMachineExpiredCommon( if h.oauth2Config != nil { resp.AuthURL = fmt.Sprintf("%s/oidc/register/%s", strings.TrimSuffix(h.cfg.ServerURL, "/"), - NodePublicKeyStripPrefix(registerRequest.NodeKey)) + registerRequest.NodeKey) } else { resp.AuthURL = fmt.Sprintf("%s/register/%s", strings.TrimSuffix(h.cfg.ServerURL, "/"),