When an authorisation to deprive liberty ends: