index.js 1.57 KB
import Vue from 'vue'
import Router from 'vue-router'
import { authGuard } from "../auth/authGuard"
import LandingPage from '@/components/LandingPage'
import SignUp from '@/components/SignUp'
import Reset from '@/components/Reset'
import Profile from '@/components/Profile'
import welcome from '@/components/welcome'
import Intermediate from '@/components/Intermediate'
import Insight from '@/components/Insight'

import router from '../router'
Vue.use(Router)

export default new Router({
    mode: 'history',
    routes: [{
            path: '/',
            name: 'LandingPage',
            component: LandingPage,
            // beforeEnter: function(to, from, next) {
            //     var userdata = localStorage.getItem('spotlight_usertoken')
            //     if (userdata) {
            //         router.push({ name: 'Welcome' })
            //     }
            //     next()
            // }
        },
        {
            path: '/signup',
            name: 'SignUp',
            component: SignUp,
        },
        {
            path: '/intermediate',
            name: 'Intermediate',
            component: Intermediate
        },
        {
            path: '/reset',
            name: 'Reset',
            component: Reset,
        },
        {
            path: '/profile',
            name: 'Profile',
            component: Profile,
        },
        {
            path: '/insight',
            name: 'Insight',
            component: Insight,
        }
        
    ],
    scrollBehavior(to, from, savedPosition) {
        this.seen = false
        return { x: 0, y: 0 }
    }
})