From 2c8270f24c58079fbb779f884033f8ef1927d2e9 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sun, 29 Mar 2020 22:52:32 +0300 Subject: [PATCH] Put message in a variable --- src/permission.js | 2 +- src/store/modules/user.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/permission.js b/src/permission.js index bb0abce8..b7c82f5c 100644 --- a/src/permission.js +++ b/src/permission.js @@ -37,7 +37,7 @@ export const beforeEachRoute = (to, from, next) => { dangerouslyUseHTMLString: true, message: err, type: 'error', - duration: 7 * 1000 + duration: 10 * 1000 }) next({ path: '/' }) }) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index c8d3c03a..861d4192 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -81,6 +81,9 @@ const user = { return new Promise((resolve, reject) => { getUserInfo(state.token, state.authHost).then(response => { const data = response.data + const message = 'This user doesn\`t have admin rights. Try another credentials or see the ' + + 'docs' + + ' to find out how to make this user an admin' 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('This user doesn\`t have admin rights. Try another credentials or see ' + - 'docs' + - ' to find out how to make this user an admin') + reject(message) } commit('SET_NAME', data.username)