Skip to content

Commit

Permalink
Merge pull request tuandm#172 from tuandm/bugfix/issue-170-can-not-lo…
Browse files Browse the repository at this point in the history
…gin-with-non-admin

Issue 170: Can not login with non-admin account
  • Loading branch information
tuandm authored Apr 22, 2020
2 parents aecfa1b + b709591 commit 4bbc195
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/js/permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ router.beforeEach(async(to, from, next) => {
const { roles, permissions } = await store.dispatch('user/getInfo');

// generate accessible routes map based on roles
const accessRoutes = await store.dispatch('permission/generateRoutes', roles, permissions);
const accessRoutes = await store.dispatch('permission/generateRoutes', { roles, permissions });
router.addRoutes(accessRoutes);
next({ ...to, replace: true });
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/store/modules/permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const mutations = {
};

const actions = {
generateRoutes({ commit }, roles, permissions) {
generateRoutes({ commit }, { roles, permissions }) {
return new Promise(resolve => {
let accessedRoutes;
if (roles.includes('admin')) {
Expand Down

0 comments on commit 4bbc195

Please sign in to comment.