Make "authKey" a constant
This commit is contained in:
parent
35c3fe9608
commit
a8a8f01429
9 changed files with 36 additions and 33 deletions
7
api.go
7
api.go
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue