mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
fix api/client_server/session events
And also add a new event for logging out to match the one for logging in because why not.
This commit is contained in:
parent
0aef00c58b
commit
60b89aba78
1 changed files with 6 additions and 4 deletions
|
|
@ -79,7 +79,7 @@ pub(crate) async fn login_route(
|
|||
} else if let Some(user) = user {
|
||||
UserId::parse(user)
|
||||
} else {
|
||||
warn!("Bad login type: {:?}", &body.login_info);
|
||||
warn!(kind = ?body.login_info, "Bad login kind");
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::forbidden(),
|
||||
"Bad login type.",
|
||||
|
|
@ -184,7 +184,7 @@ pub(crate) async fn login_route(
|
|||
} else if let Some(user) = user {
|
||||
UserId::parse(user)
|
||||
} else {
|
||||
warn!("Bad login type: {:?}", &body.login_info);
|
||||
warn!(kind = ?body.login_info, "Bad login kind");
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::forbidden(),
|
||||
"Bad login type.",
|
||||
|
|
@ -214,7 +214,7 @@ pub(crate) async fn login_route(
|
|||
user_id
|
||||
}
|
||||
_ => {
|
||||
warn!("Unsupported or unknown login type: {:?}", &body.login_info);
|
||||
warn!(kind = ?body.login_info, "Unsupported or unknown login kind");
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Unknown,
|
||||
"Unsupported login type.",
|
||||
|
|
@ -250,7 +250,7 @@ pub(crate) async fn login_route(
|
|||
)?;
|
||||
}
|
||||
|
||||
info!("{} logged in", user_id);
|
||||
info!(%user_id, %device_id, "User logged in");
|
||||
|
||||
// Homeservers are still required to send the `home_server` field
|
||||
#[allow(deprecated)]
|
||||
|
|
@ -292,6 +292,8 @@ pub(crate) async fn logout_route(
|
|||
|
||||
services().users.remove_device(sender_user, sender_device)?;
|
||||
|
||||
info!(user_id = %sender_user, device_id = %sender_device, "User logged out");
|
||||
|
||||
Ok(Ra(logout::v3::Response::new()))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue