From f4ea6fb6c577d41f72cc33283e42492e03833f00 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Sat, 6 May 2023 00:44:46 -0600 Subject: AƱade ruta account MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/token.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/lib/token.ts') diff --git a/src/lib/token.ts b/src/lib/token.ts index 8508cac..f838ac0 100644 --- a/src/lib/token.ts +++ b/src/lib/token.ts @@ -1,4 +1,12 @@ +import { ApiClient } from "../clients/api_client"; + export default class Token { + client: ApiClient; + + constructor() { + this.client = new ApiClient(); + } + get() { return sessionStorage.getItem("token"); } @@ -23,4 +31,8 @@ export default class Token { sessionStorage.removeItem("token"); sessionStorage.removeItem("refresh"); } + + refresh() { + this.client.post("/refresh_tokens") + } } \ No newline at end of file -- cgit v1.2.3