Skip to content

Commit fe1d15a

Browse files
committed
graphql: expose the humanName field on OAuth 2.0 sessions
1 parent 3b6581a commit fe1d15a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

crates/handlers/src/graphql/model/oauth.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ impl OAuth2Session {
128128
pub async fn last_active_at(&self) -> Option<DateTime<Utc>> {
129129
self.0.last_active_at
130130
}
131+
132+
/// The user-provided name for this session.
133+
pub async fn human_name(&self) -> Option<&str> {
134+
self.0.human_name.as_deref()
135+
}
131136
}
132137

133138
/// The application type advertised by the client.

frontend/schema.graphql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,10 @@ type Oauth2Session implements Node & CreationEvent {
10641064
The last time the session was active.
10651065
"""
10661066
lastActiveAt: DateTime
1067+
"""
1068+
The user-provided name for this session.
1069+
"""
1070+
humanName: String
10671071
}
10681072

10691073
type Oauth2SessionConnection {

frontend/src/gql/graphql.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,8 @@ export type Oauth2Session = CreationEvent & Node & {
776776
createdAt: Scalars['DateTime']['output'];
777777
/** When the session ended. */
778778
finishedAt?: Maybe<Scalars['DateTime']['output']>;
779+
/** The user-provided name for this session. */
780+
humanName?: Maybe<Scalars['String']['output']>;
779781
/** ID of the object. */
780782
id: Scalars['ID']['output'];
781783
/** The last time the session was active. */

0 commit comments

Comments
 (0)