mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-28 11:09:52 +09:00
Delete ephemeral machines on logout
Update changelog Use dedicated method to delete
This commit is contained in:
@@ -622,6 +622,20 @@ func (h *Headscale) handleMachineLogOutCommon(
|
||||
Caller().
|
||||
Err(err).
|
||||
Msg("Failed to write response")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if machine.isEphemeral() {
|
||||
err = h.HardDeleteMachine(&machine)
|
||||
if err != nil {
|
||||
log.Error().
|
||||
Err(err).
|
||||
Str("machine", machine.Hostname).
|
||||
Msg("Cannot delete ephemeral machine from the database")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
log.Info().
|
||||
|
||||
Reference in New Issue
Block a user