Login with OIDC after having been logged out (#1719)

This commit is contained in:
DeveloperDragon 2024-02-05 10:45:35 +01:00 committed by GitHub
parent 4ea12f472a
commit cbf57e27a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -199,6 +199,19 @@ func (h *Headscale) handleRegister(
return return
} }
// When logged out and reauthenticating with OIDC, the OldNodeKey is not passed, but the NodeKey has changed
if node.NodeKey.String() != registerRequest.NodeKey.String() &&
registerRequest.OldNodeKey.IsZero() && !node.IsExpired() {
h.handleNodeKeyRefresh(
writer,
registerRequest,
*node,
machineKey,
)
return
}
if registerRequest.Followup != "" { if registerRequest.Followup != "" {
select { select {
case <-req.Context().Done(): case <-req.Context().Done():