diff --git a/frontend/src/API/API.ts b/frontend/src/API/API.ts index 24854c0..f33c87c 100644 --- a/frontend/src/API/API.ts +++ b/frontend/src/API/API.ts @@ -9,6 +9,8 @@ interface API { removeUser(username: string): Promise; /** Create a project */ createProject(project: NewProject): Promise; + /** Renew the token */ + renewToken(token: string): Promise; } // Export an instance of the API @@ -42,4 +44,14 @@ export const api: API = { body: JSON.stringify(project), }).then((res) => res.json() as Promise); }, + + async renewToken(token: string): Promise { + return fetch("/api/loginrenew", { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: "Bearer " + token, + }, + }).then((res) => res.json() as Promise); + }, };