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

Store the browser user-agent when starting a browser session

This commit is contained in:
Quentin Gliech
2023-08-29 16:45:42 +02:00
parent 1849b86a7d
commit 5d3b8cd92f
16 changed files with 87 additions and 26 deletions

View File

@@ -114,6 +114,7 @@ pub trait BrowserSessionRepository: Send + Sync {
/// * `rng`: The random number generator to use
/// * `clock`: The clock used to generate timestamps
/// * `user`: The user to create the session for
/// * `user_agent`: If available, the user agent of the browser
///
/// # Errors
///
@@ -123,6 +124,7 @@ pub trait BrowserSessionRepository: Send + Sync {
rng: &mut (dyn RngCore + Send),
clock: &dyn Clock,
user: &User,
user_agent: Option<String>,
) -> Result<BrowserSession, Self::Error>;
/// Finish a [`BrowserSession`]
@@ -234,6 +236,7 @@ repository_impl!(BrowserSessionRepository:
rng: &mut (dyn RngCore + Send),
clock: &dyn Clock,
user: &User,
user_agent: Option<String>,
) -> Result<BrowserSession, Self::Error>;
async fn finish(
&mut self,