1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-23 11:02:35 +03:00

add finishedAt to browser sessions

This commit is contained in:
Kerry Archibald
2023-08-29 20:46:29 +12:00
committed by Quentin Gliech
parent 85629820fd
commit feb59344f3
3 changed files with 24 additions and 12 deletions

View File

@@ -27,6 +27,7 @@ const FRAGMENT = graphql(/* GraphQL */ `
fragment BrowserSession_session on BrowserSession { fragment BrowserSession_session on BrowserSession {
id id
createdAt createdAt
finishedAt
lastAuthentication { lastAuthentication {
id id
createdAt createdAt
@@ -92,7 +93,13 @@ const BrowserSession: React.FC<Props> = ({ session, isCurrent }) => {
const sessionName = isCurrent ? "Current browser session" : "Browser session"; const sessionName = isCurrent ? "Current browser session" : "Browser session";
return ( return (
<Session id={data.id} name={sessionName} createdAt={createdAt}> <Session
id={data.id}
name={sessionName}
createdAt={createdAt}
finishedAt={data.finishedAt}
>
{!data.finishedAt && (
<Button <Button
kind="destructive" kind="destructive"
size="sm" size="sm"
@@ -101,6 +108,7 @@ const BrowserSession: React.FC<Props> = ({ session, isCurrent }) => {
> >
Sign out Sign out
</Button> </Button>
)}
</Session> </Session>
); );
}; };

View File

@@ -19,7 +19,7 @@ const documents = {
types.CurrentViewerSessionQueryDocument, types.CurrentViewerSessionQueryDocument,
"\n mutation AddEmail($userId: ID!, $email: String!) {\n addEmail(input: { userId: $userId, email: $email }) {\n status\n email {\n id\n ...UserEmail_email\n }\n }\n }\n": "\n mutation AddEmail($userId: ID!, $email: String!) {\n addEmail(input: { userId: $userId, email: $email }) {\n status\n email {\n id\n ...UserEmail_email\n }\n }\n }\n":
types.AddEmailDocument, types.AddEmailDocument,
"\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n": "\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n finishedAt\n lastAuthentication {\n id\n createdAt\n }\n }\n":
types.BrowserSession_SessionFragmentDoc, types.BrowserSession_SessionFragmentDoc,
"\n mutation EndBrowserSession($id: ID!) {\n endBrowserSession(input: { browserSessionId: $id }) {\n status\n browserSession {\n id\n ...BrowserSession_session\n }\n }\n }\n": "\n mutation EndBrowserSession($id: ID!) {\n endBrowserSession(input: { browserSessionId: $id }) {\n status\n browserSession {\n id\n ...BrowserSession_session\n }\n }\n }\n":
types.EndBrowserSessionDocument, types.EndBrowserSessionDocument,
@@ -105,8 +105,8 @@ export function graphql(
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/ */
export function graphql( export function graphql(
source: "\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n", source: "\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n finishedAt\n lastAuthentication {\n id\n createdAt\n }\n }\n",
): (typeof documents)["\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n"]; ): (typeof documents)["\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n finishedAt\n lastAuthentication {\n id\n createdAt\n }\n }\n"];
/** /**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/ */

View File

@@ -940,6 +940,7 @@ export type BrowserSession_SessionFragment = {
__typename?: "BrowserSession"; __typename?: "BrowserSession";
id: string; id: string;
createdAt: any; createdAt: any;
finishedAt?: any | null;
lastAuthentication?: { lastAuthentication?: {
__typename?: "Authentication"; __typename?: "Authentication";
id: string; id: string;
@@ -1405,6 +1406,7 @@ export const BrowserSession_SessionFragmentDoc = {
selections: [ selections: [
{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "id" } },
{ kind: "Field", name: { kind: "Name", value: "createdAt" } }, { kind: "Field", name: { kind: "Name", value: "createdAt" } },
{ kind: "Field", name: { kind: "Name", value: "finishedAt" } },
{ {
kind: "Field", kind: "Field",
name: { kind: "Name", value: "lastAuthentication" }, name: { kind: "Name", value: "lastAuthentication" },
@@ -2024,6 +2026,7 @@ export const EndBrowserSessionDocument = {
selections: [ selections: [
{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "id" } },
{ kind: "Field", name: { kind: "Name", value: "createdAt" } }, { kind: "Field", name: { kind: "Name", value: "createdAt" } },
{ kind: "Field", name: { kind: "Name", value: "finishedAt" } },
{ {
kind: "Field", kind: "Field",
name: { kind: "Name", value: "lastAuthentication" }, name: { kind: "Name", value: "lastAuthentication" },
@@ -2254,6 +2257,7 @@ export const BrowserSessionListDocument = {
selections: [ selections: [
{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "id" } },
{ kind: "Field", name: { kind: "Name", value: "createdAt" } }, { kind: "Field", name: { kind: "Name", value: "createdAt" } },
{ kind: "Field", name: { kind: "Name", value: "finishedAt" } },
{ {
kind: "Field", kind: "Field",
name: { kind: "Name", value: "lastAuthentication" }, name: { kind: "Name", value: "lastAuthentication" },