Switch to using nodeKey instead of machineKey for expired machines registration

Signed-off-by: Laurent Marchaud <laurent@marchaud.com>
This commit is contained in:
Laurent Marchaud 2022-08-19 15:48:35 +02:00
parent fca33aacbe
commit e85562268d
No known key found for this signature in database
GPG Key ID: FAD4D3279AE317C5
2 changed files with 2 additions and 2 deletions

2
api.go
View File

@ -348,7 +348,7 @@ func (h *Headscale) RegistrationHandler(
machine.Expiry = &time.Time{} machine.Expiry = &time.Time{}
h.registrationCache.Set( h.registrationCache.Set(
machineKeyStr, NodePublicKeyStripPrefix(registerRequest.NodeKey),
*machine, *machine,
registerCacheExpiration, registerCacheExpiration,
) )

View File

@ -803,7 +803,7 @@ func (h *Headscale) RegisterMachineFromAuthCallback(
) )
if err == nil { if err == nil {
h.registrationCache.Delete(machineKeyStr) h.registrationCache.Delete(nodeKeyStr)
} }
return machine, err return machine, err