Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Role Login routing not working #43

@kyoukhana

Description

@kyoukhana

When a user logins successfully i get the following returned data.

{"token":"TOKENKEY","roles":"2"}

My Auth Options
Login Data returns both token and roles

var options = {
    token: [{name: 'token', authType: 'bearer', foundIn: 'response'}],
    loginData: {url: 'api/auth', method: 'POST', redirect: 'dashboard'},
    fetchData: {url: 'api/acnt', method: 'GET'},
    rolesVar: 'roles'
};

In My routing i have the following routes

Vue.router.map({
    '/auth/login': {
        component: (resolve) => { require(['./components/views/login.vue'], resolve); }
},

'dashboard': {
    auth: ["1"],
    name:"dashboard",
        component: (resolve) => { require(['./components/views/dashboard.vue'], resolve); }
});

It Doesn't Route to the dashboard. If I remove auth: ["1"] to auth:true. It works. I am getting the following error

TypeError: this.watch.data is undefined
[Learn More]app.js:15062:58
[vue-router] Uncaught error during transition: 

here is a list of vue resources i am using

"@websanova/vue-auth": "^1.4.0-beta",
    "vue": "^1.0.26",
    "vue-hot-reload-api": "^2.0.6",
    "vue-html-loader": "1.2.3",
    "vue-loader": "8.5.4",
    "vue-mdl": "^0.9.4",
    "vue-resource": "^1.0.3",
    "vue-router": "^0.7.13",
    "vue-strap": "^1.0.11",
    "vue-style-loader": "^1.0.0",
    "vuex": "^1.0.0-rc.2",

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions