add and use isAuthenticated method

This commit is contained in:
2017-02-14 20:37:16 -07:00
parent b800513800
commit faee26c586
3 changed files with 8 additions and 4 deletions

View File

@@ -22,7 +22,7 @@
</template>
<script>
import { getUser } from '../lib/authentication';
import { isAuthenticated } from '../lib/authentication';
import TopNav from '../components/TopNav.vue';
export default {
@@ -43,7 +43,7 @@
return { name: 'customers' };
}
return getUser().then(user => {
return isAuthenticated().then(user => {
const sendTo = getRedirect();
// if already logged in, redirect
if (user) return next(sendTo);