mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 13:11:02 +00:00
feat(frontend): hide revoked api tokens (#307)
This commit is contained in:
parent
9a729ed588
commit
4cef4f75ac
1 changed files with 5 additions and 2 deletions
|
|
@ -9,7 +9,10 @@ import { Spinner } from "./ui/Spinner";
|
||||||
export const AuthApiTokens: React.FC = () => {
|
export const AuthApiTokens: React.FC = () => {
|
||||||
const { apiTokens, isLoading, createToken, revokeToken } = useApiTokens();
|
const { apiTokens, isLoading, createToken, revokeToken } = useApiTokens();
|
||||||
const sortedTokens = useMemo(
|
const sortedTokens = useMemo(
|
||||||
() => apiTokens.sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1)),
|
() =>
|
||||||
|
apiTokens
|
||||||
|
.filter((token) => !token.revokedAt)
|
||||||
|
.sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1)),
|
||||||
[apiTokens],
|
[apiTokens],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -22,7 +25,7 @@ export const AuthApiTokens: React.FC = () => {
|
||||||
<p className="mb-4">
|
<p className="mb-4">
|
||||||
You can use API Tokens to access the Listory API directly. You can
|
You can use API Tokens to access the Listory API directly. You can
|
||||||
find the API docs{" "}
|
find the API docs{" "}
|
||||||
<a href="/api/docs" target="_blank">
|
<a href="/api/docs" target="_blank" className={"underline"}>
|
||||||
here
|
here
|
||||||
</a>
|
</a>
|
||||||
.
|
.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue