forked from AkkomaGang/admin-fe
Make error message more user-friendly when non-admin user tries to log in
This commit is contained in:
parent
2e22228dd2
commit
e7167b88f3
2 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue