mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-04-29 19:47:09 -04:00
fix(sdk): Don't include access and refresh token in Debug output of Session
This commit is contained in:
committed by
Jonas Platte
parent
a50743874f
commit
0aba22855b
@@ -15,6 +15,8 @@
|
||||
|
||||
//! User sessions.
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use ruma::{api::client::session::refresh_token, OwnedDeviceId, OwnedUserId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -36,7 +38,7 @@ use serde::{Deserialize, Serialize};
|
||||
///
|
||||
/// assert_eq!(session.device_id.as_str(), "MYDEVICEID");
|
||||
/// ```
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Session {
|
||||
/// The access token used for this session.
|
||||
pub access_token: String,
|
||||
@@ -66,6 +68,15 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Session {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Session")
|
||||
.field("user_id", &self.user_id)
|
||||
.field("device_id", &self.device_id)
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ruma::api::client::session::login::v3::Response> for Session {
|
||||
fn from(response: ruma::api::client::session::login::v3::Response) -> Self {
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user