Make "authKey" a constant

This commit is contained in:
Kristoffer Dalby 2021-11-18 08:49:55 +00:00
parent 35c3fe9608
commit a8a8f01429
9 changed files with 36 additions and 33 deletions

7
api.go
View file

@ -18,7 +18,10 @@ import (
"tailscale.com/types/wgkey"
)
const reservedResponseHeaderSize = 4
const (
reservedResponseHeaderSize = 4
RegisterMethodAuthKey = "authKey"
)
// KeyHandler provides the Headscale pub key
// Listens in /key.
@ -536,7 +539,7 @@ func (h *Headscale) handleAuthKey(
HexString()
// we update it just in case
machine.Registered = true
machine.RegisterMethod = "authKey"
machine.RegisterMethod = RegisterMethodAuthKey
h.db.Save(&machine)
pak.Used = true