Skip to content
Snippets Groups Projects
Commit e7167b88 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

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

parent 2e22228d
No related branches found
No related tags found
No related merge requests found
......@@ -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: '/' })
})
})
......
......@@ -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)
......
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