Skip to content

Commit

Permalink
Fix expired node registration URL
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfont committed Aug 13, 2022
1 parent 09cd7ba commit a7efc22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ func (h *Headscale) handleMachineExpired(
resp.AuthURL = fmt.Sprintf("%s/oidc/register/%s",
strings.TrimSuffix(h.cfg.ServerURL, "/"), machineKey.String())
} else {
resp.AuthURL = fmt.Sprintf("%s/register?key=%s",
strings.TrimSuffix(h.cfg.ServerURL, "/"), machineKey.String())
resp.AuthURL = fmt.Sprintf("%s/register/%s",
strings.TrimSuffix(h.cfg.ServerURL, "/"), NodePublicKeyStripPrefix(registerRequest.NodeKey))
}

respBody, err := encode(resp, &machineKey, h.privateKey)
Expand Down

0 comments on commit a7efc22

Please sign in to comment.