add to cache as part of cli reauth

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2025-01-17 13:22:47 +01:00
parent b177b24c6d
commit 2d4500f60f
No known key found for this signature in database

View file

@ -255,14 +255,18 @@ func (h *Headscale) handleRegister(
// TODO(juan): RegisterRequest includes an Expiry time, that we could optionally use // TODO(juan): RegisterRequest includes an Expiry time, that we could optionally use
node.Expiry = &time.Time{} node.Expiry = &time.Time{}
// TODO(kradalby): do we need to rethink this as part of authflow?
// If we are here it means the client needs to be reauthorized, // If we are here it means the client needs to be reauthorized,
// we need to make sure the NodeKey matches the one in the request // we need to make sure the NodeKey matches the one in the request
// TODO(juan): What happens when using fast user switching between two // TODO(juan): What happens when using fast user switching between two
// headscale-managed tailnets? // headscale-managed tailnets?
node.NodeKey = regReq.NodeKey node.NodeKey = regReq.NodeKey
h.registrationCache.Set( h.registrationCache.Set(
machineKey.String(), registrationId,
*node, types.RegisterNode{
Node: *node,
Registered: make(chan struct{}),
},
) )
return return