Skip to content

Commit

Permalink
Do not strip nodekey prefix on handle expired
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfont committed Nov 15, 2022
1 parent c5ba755 commit 275cc28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion protocol_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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, "/"),
Expand Down

0 comments on commit 275cc28

Please sign in to comment.