From 8040a87759746c81694d2cbd1fb82039eb0e68f0 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Sat, 6 May 2023 00:02:56 -0600 Subject: Agregado dropdown menu de autenticación MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/token.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lib/token.ts') diff --git a/src/lib/token.ts b/src/lib/token.ts index 113e76d..8508cac 100644 --- a/src/lib/token.ts +++ b/src/lib/token.ts @@ -14,4 +14,13 @@ export default class Token { setRefresh(refresh_token: string) { sessionStorage.setItem("refresh", refresh_token); } + + present() { + return sessionStorage.getItem("token") != null; + } + + logout() { + sessionStorage.removeItem("token"); + sessionStorage.removeItem("refresh"); + } } \ No newline at end of file -- cgit v1.2.3