mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-02 03:33:05 +00:00
Use valid handler for registered authkey machines
This commit is contained in:
parent
a8a8f01429
commit
50dcb8bb75
1 changed files with 9 additions and 2 deletions
11
api.go
11
api.go
|
@ -130,8 +130,15 @@ func (h *Headscale) RegistrationHandler(ctx *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if machine.Registered && machine.Expiry.UTC().After(now) {
|
// We dont care about expiry time if the method is AuthKey, as we dont set that.
|
||||||
h.handleMachineValidRegistration(ctx, machineKey, req, *machine)
|
if machine.Registered && machine.RegisterMethod == RegisterMethodAuthKey {
|
||||||
|
h.handleMachineValidRegistration(ctx, machineKey, *machine)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if machine.Registered && !machine.isExpired() {
|
||||||
|
h.handleMachineValidRegistration(ctx, machineKey, *machine)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue