Skip to content
Snippets Groups Projects
Unverified Commit 9555ac7b authored by Timshel's avatar Timshel Committed by GitHub
Browse files

Remove compatibility route (#4578)

parent f01ef40a
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,6 @@ pub fn routes() -> Vec<rocket::Route> { ...@@ -50,7 +50,6 @@ pub fn routes() -> Vec<rocket::Route> {
api_key, api_key,
rotate_api_key, rotate_api_key,
get_known_device, get_known_device,
get_known_device_from_path,
put_avatar, put_avatar,
put_device_token, put_device_token,
put_clear_device_token, put_clear_device_token,
...@@ -979,22 +978,15 @@ async fn rotate_api_key(data: JsonUpcase<PasswordOrOtpData>, headers: Headers, c ...@@ -979,22 +978,15 @@ async fn rotate_api_key(data: JsonUpcase<PasswordOrOtpData>, headers: Headers, c
_api_key(data, true, headers, conn).await _api_key(data, true, headers, conn).await
} }
// This variant is deprecated: https://github.com/bitwarden/server/pull/2682 #[get("/devices/knowndevice")]
#[get("/devices/knowndevice/<email>/<uuid>")] async fn get_known_device(device: KnownDevice, mut conn: DbConn) -> JsonResult {
async fn get_known_device_from_path(email: &str, uuid: &str, mut conn: DbConn) -> JsonResult {
// This endpoint doesn't have auth header
let mut result = false; let mut result = false;
if let Some(user) = User::find_by_mail(email, &mut conn).await { if let Some(user) = User::find_by_mail(&device.email, &mut conn).await {
result = Device::find_by_uuid_and_user(uuid, &user.uuid, &mut conn).await.is_some(); result = Device::find_by_uuid_and_user(&device.uuid, &user.uuid, &mut conn).await.is_some();
} }
Ok(Json(json!(result))) Ok(Json(json!(result)))
} }
#[get("/devices/knowndevice")]
async fn get_known_device(device: KnownDevice, conn: DbConn) -> JsonResult {
get_known_device_from_path(&device.email, &device.uuid, conn).await
}
struct KnownDevice { struct KnownDevice {
email: String, email: String,
uuid: String, uuid: String,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment