From ac0f9ff5d3c99a4383e16fea0a2d95c18cee41ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Mon, 20 Feb 2023 23:50:57 +0100 Subject: [PATCH] feat(frontend): manage API tokens in Frontend --- frontend/src/App.tsx | 2 + frontend/src/api/api.ts | 63 +++++++ frontend/src/api/entities/api-token.ts | 14 ++ frontend/src/components/AuthApiTokens.tsx | 197 ++++++++++++++++++++++ frontend/src/components/NavBar.tsx | 67 ++++++-- frontend/src/hooks/use-api.tsx | 40 ++++- frontend/src/hooks/useOutsideClick.tsx | 26 +++ frontend/src/icons/Cogwheel.tsx | 21 +++ frontend/src/icons/Trashcan.tsx | 23 +++ src/auth/auth.controller.ts | 39 +++-- src/auth/auth.service.ts | 12 +- src/auth/dto/api-token.dto.ts | 7 + src/auth/dto/new-api-token.dto.ts | 6 + 13 files changed, 484 insertions(+), 33 deletions(-) create mode 100644 frontend/src/api/entities/api-token.ts create mode 100644 frontend/src/components/AuthApiTokens.tsx create mode 100644 frontend/src/hooks/useOutsideClick.tsx create mode 100644 frontend/src/icons/Cogwheel.tsx create mode 100644 frontend/src/icons/Trashcan.tsx create mode 100644 src/auth/dto/api-token.dto.ts create mode 100644 src/auth/dto/new-api-token.dto.ts diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 92fb639..9b12446 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,5 +1,6 @@ import React from "react"; import { Route, Routes } from "react-router-dom"; +import { AuthApiTokens } from "./components/AuthApiTokens"; import { Footer } from "./components/Footer"; import { LoginFailure } from "./components/LoginFailure"; import { LoginLoading } from "./components/LoginLoading"; @@ -36,6 +37,7 @@ export function App() { } /> } /> } /> + } />