diff --git a/src/frontend/src/pages/Index/Settings/AccountSettings/SecurityContent.tsx b/src/frontend/src/pages/Index/Settings/AccountSettings/SecurityContent.tsx
index 1d23e34503..1b5b32d4f1 100644
--- a/src/frontend/src/pages/Index/Settings/AccountSettings/SecurityContent.tsx
+++ b/src/frontend/src/pages/Index/Settings/AccountSettings/SecurityContent.tsx
@@ -23,18 +23,23 @@ import { hideNotification, showNotification } from '@mantine/notifications';
import {
IconAlertCircle,
IconAt,
+ IconCircleX,
IconExclamationCircle,
IconX
} from '@tabler/icons-react';
import { useQuery } from '@tanstack/react-query';
-import { useMemo, useState } from 'react';
+import { useCallback, useMemo, useState } from 'react';
import { api } from '../../../../App';
-import { YesNoButton } from '../../../../components/buttons/YesNoButton';
import { StylishText } from '../../../../components/items/StylishText';
import { ApiEndpoints } from '../../../../enums/ApiEndpoints';
import { ProviderLogin, authApi } from '../../../../functions/auth';
+import { showApiErrorMessage } from '../../../../functions/notifications';
+import { useTable } from '../../../../hooks/UseTable';
import { apiUrl, useServerApiState } from '../../../../states/ApiState';
import type { AuthConfig, Provider } from '../../../../states/states';
+import { BooleanColumn } from '../../../../tables/ColumnRenderers';
+import { InvenTreeTable } from '../../../../tables/InvenTreeTable';
+import type { RowAction } from '../../../../tables/RowActions';
import { QrRegistrationForm } from './QrRegistrationForm';
import { useReauth } from './useConfirm';
@@ -710,83 +715,66 @@ async function runActionWithFallback(
}
function TokenSection() {
- const { isLoading, data, refetch } = useQuery({
- queryKey: ['token-list'],
- queryFn: () =>
- api.get(apiUrl(ApiEndpoints.user_tokens)).then((res) => res.data)
- });
+ const table = useTable('api-tokens', 'id');
- function revokeToken(id: string) {
+ const tableColumns = useMemo(() => {
+ return [
+ {
+ accessor: 'name'
+ },
+ BooleanColumn({
+ accessor: 'active'
+ }),
+ {
+ accessor: 'token'
+ },
+ {
+ accessor: 'last_seen'
+ },
+ {
+ accessor: 'expiry'
+ }
+ ];
+ }, []);
+
+ const rowActions = useCallback((record: any): RowAction[] => {
+ return [
+ {
+ title: t`Revoke`,
+ color: 'red',
+ hidden: !record.active || record.in_use,
+ icon: