Put message in a variable
This commit is contained in:
parent
b5aba2cc81
commit
2c8270f24c
2 changed files with 5 additions and 4 deletions
|
@ -37,7 +37,7 @@ export const beforeEachRoute = (to, from, next) => {
|
|||
dangerouslyUseHTMLString: true,
|
||||
message: err,
|
||||
type: 'error',
|
||||
duration: 7 * 1000
|
||||
duration: 10 * 1000
|
||||
})
|
||||
next({ path: '/' })
|
||||
})
|
||||
|
|
|
@ -81,6 +81,9 @@ const user = {
|
|||
return new Promise((resolve, reject) => {
|
||||
getUserInfo(state.token, state.authHost).then(response => {
|
||||
const data = response.data
|
||||
const message = '<span>This user doesn\`t have admin rights. Try another credentials or see the </span>' +
|
||||
'<u><a target="_blank" href="https://docs.pleroma.social/backend/administration/CLI_tasks/user/#set-the-value-of-the-given-users-settings">docs</a></u>' +
|
||||
'<span> to find out how to make this user an admin</span>'
|
||||
|
||||
if (!data) {
|
||||
reject('Verification failed, please login again.')
|
||||
|
@ -89,9 +92,7 @@ const user = {
|
|||
if (data.pleroma && data.pleroma.is_admin) {
|
||||
commit('SET_ROLES', ['admin'])
|
||||
} else {
|
||||
reject('<span>This user doesn\`t have admin rights. Try another credentials or see </span>' +
|
||||
'<u><a target="_blank" href="https://docs.pleroma.social/backend/administration/CLI_tasks/user/#set-the-value-of-the-given-users-settings">docs</a></u>' +
|
||||
'<span> to find out how to make this user an admin</span>')
|
||||
reject(message)
|
||||
}
|
||||
|
||||
commit('SET_NAME', data.username)
|
||||
|
|
Loading…
Reference in a new issue