From fd5f42c2e6241adbac3080a851d85b9883e32bfe Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 21 Nov 2021 21:14:13 +0000 Subject: [PATCH] Move handle expired machine to the end of registration --- api.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api.go b/api.go index bc1dccb..6901896 100644 --- a/api.go +++ b/api.go @@ -138,11 +138,6 @@ func (h *Headscale) RegistrationHandler(ctx *gin.Context) { return } - - // The machine has expired - h.handleMachineExpired(ctx, machineKey, req, *machine) - - return } // The NodeKey we have matches OldNodeKey, which means this is a refresh after a key expiration @@ -152,6 +147,11 @@ func (h *Headscale) RegistrationHandler(ctx *gin.Context) { return } + + // The machine has expired + h.handleMachineExpired(ctx, machineKey, req, *machine) + + return } // If the machine has AuthKey set, handle registration via PreAuthKeys