mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-04-26 18:20:40 -04:00
fix(sdk): Can't assert identity without session
This commit is contained in:
@@ -239,8 +239,11 @@ impl ClientBuilder {
|
||||
|
||||
/// All outgoing http requests will have a GET query key-value appended with
|
||||
/// `user_id` being the key and the `user_id` from the `Session` being
|
||||
/// the value. Will error if there's no `Session`. This is called
|
||||
/// [identity assertion] in the Matrix Application Service Spec
|
||||
/// the value. This is called [identity assertion] in the
|
||||
/// Matrix Application Service Spec.
|
||||
///
|
||||
/// Requests that don't require authentication might not do identity
|
||||
/// assertion.
|
||||
///
|
||||
/// [identity assertion]: https://spec.matrix.org/unstable/application-service-api/#identity-assertion
|
||||
#[doc(hidden)]
|
||||
|
||||
@@ -125,7 +125,8 @@ impl HttpClient {
|
||||
}
|
||||
|
||||
trace!("Serializing request");
|
||||
let request = if !config.assert_identity {
|
||||
// We can't assert the identity without a session.
|
||||
let request = if !config.assert_identity || session.is_none() {
|
||||
let send_access_token = if auth_scheme == AuthScheme::None && !config.force_auth {
|
||||
// Small optimization: Don't take the session lock if we know the auth token
|
||||
// isn't going to be used anyways.
|
||||
|
||||
Reference in New Issue
Block a user