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

Put message in a variable

parent b5aba2cc
No related branches found
No related tags found
2 merge requests!125WIP: Release/2.0.3,!111Add link to the docs when a non-admin user logs in
Pipeline #24004 passed
......@@ -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)
......
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