Skip to content

Commit

Permalink
Merge pull request #735 from juanfont/fix-expired-url
Browse files Browse the repository at this point in the history
Fix expired node registration URL
  • Loading branch information
juanfont committed Aug 13, 2022
2 parents 09cd7ba + 8c13f64 commit ee8f381
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,10 @@ func (h *Headscale) handleMachineExpired(

if h.cfg.OIDC.Issuer != "" {
resp.AuthURL = fmt.Sprintf("%s/oidc/register/%s",
strings.TrimSuffix(h.cfg.ServerURL, "/"), machineKey.String())
strings.TrimSuffix(h.cfg.ServerURL, "/"), NodePublicKeyStripPrefix(registerRequest.NodeKey))
} 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 ee8f381

Please sign in to comment.