Implement disconnect specific client ID

This commit is contained in:
2025-02-11 22:03:16 +01:00
parent b8a8e14f3c
commit bb1e412d36
2 changed files with 14 additions and 2 deletions

View File

@ -64,7 +64,16 @@ pub async fn ws_handler(
};
match msg {
WsMessage::CloseClientSession(_) => todo!(),
WsMessage::CloseClientSession(id) => {
if let Some(client) = &auth.client {
if client.id == id {
log::info!(
"closing client session {id:?} of user {:?} as requested", auth.user.user_id
);
break None;
}
}
},
WsMessage::CloseAllUserSessions(userid) => {
if userid == auth.user.user_id {
log::info!(