+
+ {t(
+ "Manage which third-party and internal applications have been granted access to your {{ appName }} account.",
+ { appName }
+ )}
+
+ >
+ }
renderItem={(oauthAuthentication: OAuthAuthentication) => (
{
const subtitle = (
<>
- {oauthAuthentication.lastActiveAt && (
-
- {t("Accessed data")}{" "}
- {" "}
- ·{" "}
-
- )}
+ {oauthAuthentication.lastActiveAt ? (
+ <>
+ {t("Last active")}{" "}
+
+ >
+ ) : (
+ t("Never used")
+ )}{" "}
+ ·{" "}
+
+
{OAuthScopeHelper.normalizeScopes(oauthAuthentication.scope, t).join(
", "
)}
@@ -46,6 +51,9 @@ const OAuthAuthenticationListItem = ({ oauthAuthentication }: Props) => {
}
title={oauthAuthentication.oauthClient.name}
subtitle={subtitle}
+ actions={
+
+ }
/>
);
};
diff --git a/server/models/oauth/OAuthAuthentication.ts b/server/models/oauth/OAuthAuthentication.ts
index ed86bacb79..06865bcdb7 100644
--- a/server/models/oauth/OAuthAuthentication.ts
+++ b/server/models/oauth/OAuthAuthentication.ts
@@ -12,7 +12,6 @@ import {
BelongsTo,
ForeignKey,
Table,
- BeforeCreate,
IsDate,
Unique,
} from "sequelize-typescript";
@@ -115,13 +114,6 @@ class OAuthAuthentication extends ParanoidModel<
return this.save({ silent: true });
};
- // hooks
-
- @BeforeCreate
- static async setLastActiveAt(model: OAuthAuthentication) {
- model.lastActiveAt = new Date();
- }
-
// instance methods
/** Checks if the authentication has access to the given path */
diff --git a/server/routes/api/oauthAuthentications/oauthAuthentications.ts b/server/routes/api/oauthAuthentications/oauthAuthentications.ts
index 7830b8b1e5..351647b33d 100644
--- a/server/routes/api/oauthAuthentications/oauthAuthentications.ts
+++ b/server/routes/api/oauthAuthentications/oauthAuthentications.ts
@@ -34,6 +34,7 @@ router.post(
FROM oauth_authentications oa
INNER JOIN oauth_clients oc ON oc.id = oa."oauthClientId"
WHERE oa."userId" = :userId
+ AND oa."deletedAt" IS NULL
ORDER BY oa."oauthClientId", oa."scope", oa."lastActiveAt", oa."createdAt" DESC
LIMIT :limit OFFSET :offset
`,
diff --git a/server/routes/api/oauthAuthentications/schema.ts b/server/routes/api/oauthAuthentications/schema.ts
index 9a7f8d33e2..9dce6369f9 100644
--- a/server/routes/api/oauthAuthentications/schema.ts
+++ b/server/routes/api/oauthAuthentications/schema.ts
@@ -12,7 +12,7 @@ export type OAuthAuthenticationsListReq = z.infer<
export const OAuthAuthenticationsDeleteSchema = BaseSchema.extend({
body: z.object({
oauthClientId: z.string(),
- scope: z.string().optional(),
+ scope: z.array(z.string()).optional(),
}),
});
diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json
index 8dd90ea1f1..5576e578f2 100644
--- a/shared/i18n/locales/en_US/translation.json
+++ b/shared/i18n/locales/en_US/translation.json
@@ -520,7 +520,7 @@
"Unsubscribed from document": "Unsubscribed from document",
"Unsubscribed from collection": "Unsubscribed from collection",
"Account": "Account",
- "Authorizations": "Authorizations",
+ "API & Apps": "API & Apps",
"Details": "Details",
"Security": "Security",
"Features": "Features",
@@ -561,6 +561,9 @@
"New child document": "New child document",
"Save in workspace": "Save in workspace",
"Notification settings": "Notification settings",
+ "Revoke {{ appName }}": "Revoke {{ appName }}",
+ "Revoking": "Revoking",
+ "Are you sure you want to revoke access?": "Are you sure you want to revoke access?",
"Delete app": "Delete app",
"Revision options": "Revision options",
"Share link revoked": "Share link revoked",
@@ -875,6 +878,11 @@
"Something went wrong": "Something went wrong",
"Please try again or contact support if the problem persists": "Please try again or contact support if the problem persists",
"No documents found for your search filters.": "No documents found for your search filters.",
+ "Create personal API keys to authenticate with the API and programatically control\n your workspace's data. For more details see the developer documentation.": "Create personal API keys to authenticate with the API and programatically control\n your workspace's data. For more details see the developer documentation.",
+ "{t(\"API keys have been disabled by an admin for your account\")}": "{t(\"API keys have been disabled by an admin for your account\")}",
+ "API keys have been disabled by an admin for your account": "API keys have been disabled by an admin for your account",
+ "Application access": "Application access",
+ "Manage which third-party and internal applications have been granted access to your {{ appName }} account.": "Manage which third-party and internal applications have been granted access to your {{ appName }} account.",
"API": "API",
"API keys can be used to authenticate with the API and programatically control\n your workspace's data. For more details see the developer documentation.": "API keys can be used to authenticate with the API and programatically control\n your workspace's data. For more details see the developer documentation.",
"Client secret rotated": "Client secret rotated",
@@ -900,7 +908,6 @@
"Restricted scope": "Restricted scope",
"API key copied to clipboard": "API key copied to clipboard",
"Copied": "Copied",
- "Revoking": "Revoking",
"Are you sure you want to revoke the {{ tokenName }} token?": "Are you sure you want to revoke the {{ tokenName }} token?",
"Disconnect integration": "Disconnect integration",
"Connected": "Connected",
@@ -964,7 +971,7 @@
"Drag and drop the zip file from the Markdown export option in {{appName}}, or click to upload": "Drag and drop the zip file from the Markdown export option in {{appName}}, or click to upload",
"Last active": "Last active",
"Guest": "Guest",
- "Accessed data": "Accessed data",
+ "Never used": "Never used",
"Are you sure you want to delete the {{ appName }} application? This cannot be undone.": "Are you sure you want to delete the {{ appName }} application? This cannot be undone.",
"Shared by": "Shared by",
"Date shared": "Date shared",
@@ -1050,9 +1057,6 @@
"Unsubscription successful. Your notification settings were updated": "Unsubscription successful. Your notification settings were updated",
"Manage when and where you receive email notifications.": "Manage when and where you receive email notifications.",
"The email integration is currently disabled. Please set the associated environment variables and restart the server to enable notifications.": "The email integration is currently disabled. Please set the associated environment variables and restart the server to enable notifications.",
- "Create personal API keys to authenticate with the API and programatically control\n your workspace's data. API keys have the same permissions as your user account.\n For more details see the developer documentation.": "Create personal API keys to authenticate with the API and programatically control\n your workspace's data. API keys have the same permissions as your user account.\n For more details see the developer documentation.",
- "Personal keys": "Personal keys",
- "Authentications": "Authentications",
"Preferences saved": "Preferences saved",
"Delete account": "Delete account",
"Manage settings that affect your personal experience.": "Manage settings that affect your personal experience.",