aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimshel <[email protected]>2024-05-25 15:29:58 +0200
committerGitHub <[email protected]>2024-05-25 15:29:58 +0200
commit9555ac7bb84c213221b157448f39a0b3fa521dbc (patch)
tree8d8f9e685eb17084dd08514fc5cd20954644c1b2
parentf01ef40a8ec1c59f81a575faad90bde73d3e9d48 (diff)
downloadvaultwarden-9555ac7bb84c213221b157448f39a0b3fa521dbc.tar.gz
vaultwarden-9555ac7bb84c213221b157448f39a0b3fa521dbc.zip
Remove compatibility route (#4578)
-rw-r--r--src/api/core/accounts.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs
index 5b947b85..812b6c7a 100644
--- a/src/api/core/accounts.rs
+++ b/src/api/core/accounts.rs
@@ -50,7 +50,6 @@ pub fn routes() -> Vec<rocket::Route> {
api_key,
rotate_api_key,
get_known_device,
- get_known_device_from_path,
put_avatar,
put_device_token,
put_clear_device_token,
@@ -979,22 +978,15 @@ async fn rotate_api_key(data: JsonUpcase<PasswordOrOtpData>, headers: Headers, c
_api_key(data, true, headers, conn).await
}
-// This variant is deprecated: https://github.com/bitwarden/server/pull/2682
-#[get("/devices/knowndevice/<email>/<uuid>")]
-async fn get_known_device_from_path(email: &str, uuid: &str, mut conn: DbConn) -> JsonResult {
- // This endpoint doesn't have auth header
+#[get("/devices/knowndevice")]
+async fn get_known_device(device: KnownDevice, mut conn: DbConn) -> JsonResult {
let mut result = false;
- if let Some(user) = User::find_by_mail(email, &mut conn).await {
- result = Device::find_by_uuid_and_user(uuid, &user.uuid, &mut conn).await.is_some();
+ if let Some(user) = User::find_by_mail(&device.email, &mut conn).await {
+ result = Device::find_by_uuid_and_user(&device.uuid, &user.uuid, &mut conn).await.is_some();
}
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 {
email: String,
uuid: String,