Make error message more user-friendly when non-admin user tries to log in

This commit is contained in:
Angelina Filippova 2020-03-26 22:29:41 +03:00
parent 2e22228dd2
commit e7167b88f3
2 changed files with 6 additions and 2 deletions

View file

@ -33,7 +33,11 @@ export const beforeEachRoute = (to, from, next) => {
})
}).catch((err) => {
store.dispatch('FedLogOut').then(() => {
Message.error(err)
Message({
message: err,
type: 'error',
duration: 7 * 1000
})
next({ path: '/' })
})
})

View file

@ -89,7 +89,7 @@ const user = {
if (data.pleroma && data.pleroma.is_admin) {
commit('SET_ROLES', ['admin'])
} else {
reject('getInfo: roles must be a non-null array!')
reject('This user doesn\`t have admin rights. Try another credentials or run `MIX_ENV=prod mix pleroma.user set NICKNAME --admin`')
}
commit('SET_NAME', data.username)