diff --git a/api.go b/api.go index d11971b6..b8169111 100644 --- a/api.go +++ b/api.go @@ -21,6 +21,8 @@ import ( const ( reservedResponseHeaderSize = 4 RegisterMethodAuthKey = "authKey" + RegisterMethodOIDC = "oidc" + RegisterMethodCLI = "cli" ) // KeyHandler provides the Headscale pub key @@ -422,8 +424,6 @@ func (h *Headscale) handleMachineRefreshKey( return } ctx.Data(http.StatusOK, "application/json; charset=utf-8", respBody) - - return } func (h *Headscale) handleMachineRegistrationNew( diff --git a/machine.go b/machine.go index dcd79700..293b26fa 100644 --- a/machine.go +++ b/machine.go @@ -660,7 +660,7 @@ func (h *Headscale) RegisterMachine( machine.IPAddress = ip.String() machine.NamespaceID = namespace.ID machine.Registered = true - machine.RegisterMethod = "cli" + machine.RegisterMethod = RegisterMethodCLI h.db.Save(&machine) log.Trace(). diff --git a/oidc.go b/oidc.go index 07561e8a..f796c908 100644 --- a/oidc.go +++ b/oidc.go @@ -223,7 +223,7 @@ func (h *Headscale) OIDCCallback(ctx *gin.Context) { machine.IPAddress = ip.String() machine.NamespaceID = namespace.ID machine.Registered = true - machine.RegisterMethod = "oidc" + machine.RegisterMethod = RegisterMethodOIDC machine.LastSuccessfulUpdate = &now h.db.Save(&machine) }