1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-09 04:22:45 +03:00

Move the /link/:device endpoint to /device/:device

It prevents browsers to try to autocomplete /link to /link/:device
This commit is contained in:
Quentin Gliech
2023-12-11 15:16:36 +01:00
parent b0042eb0c3
commit b498e5971d

View File

@@ -738,7 +738,7 @@ impl Route for DeviceCodeLink {
} }
} }
/// `GET|POST /link/:device_code_id` /// `GET|POST /device/:device_code_id`
#[derive(Default, Serialize, Deserialize, Debug, Clone)] #[derive(Default, Serialize, Deserialize, Debug, Clone)]
pub struct DeviceCodeConsent { pub struct DeviceCodeConsent {
id: Ulid, id: Ulid,
@@ -747,11 +747,11 @@ pub struct DeviceCodeConsent {
impl Route for DeviceCodeConsent { impl Route for DeviceCodeConsent {
type Query = (); type Query = ();
fn route() -> &'static str { fn route() -> &'static str {
"/link/:device_code_id" "/device/:device_code_id"
} }
fn path(&self) -> std::borrow::Cow<'static, str> { fn path(&self) -> std::borrow::Cow<'static, str> {
format!("/link/{}", self.id).into() format!("/device/{}", self.id).into()
} }
} }