Put message in a variable

This commit is contained in:
Angelina Filippova 2020-03-29 22:52:32 +03:00
parent b5aba2cc81
commit 2c8270f24c
2 changed files with 5 additions and 4 deletions

View file

@ -37,7 +37,7 @@ export const beforeEachRoute = (to, from, next) => {
dangerouslyUseHTMLString: true,
message: err,
type: 'error',
duration: 7 * 1000
duration: 10 * 1000
})
next({ path: '/' })
})

View file

@ -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)