Skip to content
Snippets Groups Projects
Commit d042d308 authored by Ilja's avatar Ilja Committed by Haelwenn
Browse files

Make sure non-admin can log in

For some reason it checks if the roles are alredy filled in.
But roles can be empty now, so instead we also check if privileges are empty.
parent bc2a600f
No related branches found
No related tags found
3 merge requests!326Mergeback: 2.5.0,!315Handle moderation privileges,!282Release/2.5.0
......@@ -24,7 +24,7 @@ export const beforeEachRoute = (to, from, next) => {
next({ path: '/' })
NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
} else {
if (store.getters.roles.length === 0) {
if (store.getters.roles.length === 0 && store.getters.privileges.length === 0) {
store.dispatch('GetUserInfo').then(res => {
const roles = res.data.pleroma.is_admin ? ['admin'] : []
store.dispatch('GenerateRoutes', { roles }).then(() => {
......
......@@ -14,6 +14,7 @@ const user = {
avatar: '',
introduction: '',
roles: [],
privileges: [],
setting: {
articlePlatform: []
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment