From 2d4500f60fc1779ef203376d7e7e6767db3ce6d8 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 17 Jan 2025 13:22:47 +0100 Subject: [PATCH] add to cache as part of cli reauth Signed-off-by: Kristoffer Dalby --- hscontrol/auth.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hscontrol/auth.go b/hscontrol/auth.go index 23d66bb5..9e22660d 100644 --- a/hscontrol/auth.go +++ b/hscontrol/auth.go @@ -255,14 +255,18 @@ func (h *Headscale) handleRegister( // TODO(juan): RegisterRequest includes an Expiry time, that we could optionally use 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, // we need to make sure the NodeKey matches the one in the request // TODO(juan): What happens when using fast user switching between two // headscale-managed tailnets? node.NodeKey = regReq.NodeKey h.registrationCache.Set( - machineKey.String(), - *node, + registrationId, + types.RegisterNode{ + Node: *node, + Registered: make(chan struct{}), + }, ) return