diff --git a/ruma-client-api/src/r0/session/sso_login.rs b/ruma-client-api/src/r0/session/sso_login.rs index 8783c928..6e7ffd1f 100644 --- a/ruma-client-api/src/r0/session/sso_login.rs +++ b/ruma-client-api/src/r0/session/sso_login.rs @@ -17,6 +17,7 @@ ruma_api! { /// URL to which the homeserver should return the user after completing /// authentication with the SSO identity provider. #[ruma_api(query)] + #[serde(rename = "redirectUrl")] pub redirect_url: &'a str, } @@ -42,3 +43,22 @@ impl Response { Self { location } } } + +#[cfg(test)] +mod tests { + use ruma_api::OutgoingRequest; + + use super::Request; + + #[test] + fn serialize_sso_login_request_uri() { + let req: http::Request> = Request { redirect_url: "https://example.com/sso" } + .try_into_http_request("https://homeserver.tld", None) + .unwrap(); + + assert_eq!( + req.uri().to_string(), + "https://homeserver.tld/_matrix/client/r0/login/sso/redirect?redirectUrl=https%3A%2F%2Fexample.com%2Fsso" + ); + } +}