From faee26c586e93e04f67aceaef6ef0a50f4d659c8 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Tue, 14 Feb 2017 20:37:16 -0700 Subject: [PATCH] add and use isAuthenticated method --- src/lib/authentication.js | 4 ++++ src/pages/Login.vue | 4 ++-- src/router.js | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/authentication.js b/src/lib/authentication.js index ca4861c..b06a17f 100644 --- a/src/lib/authentication.js +++ b/src/lib/authentication.js @@ -1,3 +1,7 @@ export function getUser() { return Promise.resolve(null); } + +export function isAuthenticated() { + return getUser().then(Boolean); +} diff --git a/src/pages/Login.vue b/src/pages/Login.vue index cb20e55..d8d99d0 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -22,7 +22,7 @@