summaryrefslogtreecommitdiff
path: root/src/lib/token.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/token.ts')
-rw-r--r--src/lib/token.ts9
1 files changed, 9 insertions, 0 deletions
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