diff --git a/crates/graphql/src/model/browser_sessions.rs b/crates/graphql/src/model/browser_sessions.rs index e07249c7..ad1e6db0 100644 --- a/crates/graphql/src/model/browser_sessions.rs +++ b/crates/graphql/src/model/browser_sessions.rs @@ -87,6 +87,11 @@ impl BrowserSession { BrowserSessionState::Active } } + + /// The user-agent string with which the session was created. + pub async fn user_agent(&self) -> Option<&str> { + self.0.user_agent.as_deref() + } } /// An authentication records when a user enter their credential in a browser diff --git a/frontend/schema.graphql b/frontend/schema.graphql index 478981cd..821534e3 100644 --- a/frontend/schema.graphql +++ b/frontend/schema.graphql @@ -95,6 +95,10 @@ type BrowserSession implements Node & CreationEvent { The state of the session. """ state: BrowserSessionState! + """ + The user-agent string with which the session was created. + """ + userAgent: String } type BrowserSessionConnection { diff --git a/frontend/src/gql/graphql.ts b/frontend/src/gql/graphql.ts index de462da6..2b39fb92 100644 --- a/frontend/src/gql/graphql.ts +++ b/frontend/src/gql/graphql.ts @@ -100,6 +100,8 @@ export type BrowserSession = CreationEvent & state: BrowserSessionState; /** The user logged in this session. */ user: User; + /** The user-agent string with which the session was created. */ + userAgent?: Maybe; }; export type BrowserSessionConnection = { diff --git a/frontend/src/gql/schema.ts b/frontend/src/gql/schema.ts index aa6ab818..e5d546ab 100644 --- a/frontend/src/gql/schema.ts +++ b/frontend/src/gql/schema.ts @@ -172,6 +172,14 @@ export default { }, args: [], }, + { + name: "userAgent", + type: { + kind: "SCALAR", + name: "Any", + }, + args: [], + }, ], interfaces: [ {