Visitar URL original
dont show unathorized notification for prelogin (#14054) · apache/cloudstack@17294ca · GitHub
Skip to content

Commit 17294ca

Browse files
authored
dont show unathorized notification for prelogin (#14054)
1 parent ed1db53 commit 17294ca

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎ui/src/utils/request.js‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ const err = (error) => {
5151
})
5252
}
5353
if (response.status === 401) {
54-
if (response.config && response.config.params && ['forgotPassword', 'listIdps', 'cloudianIsEnabled'].includes(response.config.params.command)) {
54+
const requestCommand = (response.config && response.config.params && response.config.params.command) ||
55+
(response.config && typeof response.config.data === 'string' && new URLSearchParams(response.config.data).get('command'))
56+
if (['forgotPassword', 'listIdps', 'cloudianIsEnabled'].includes(requestCommand)) {
5557
return
5658
}
5759
const originalPath = router.currentRoute.value.path
@@ -75,9 +77,9 @@ const err = (error) => {
7577
}
7678
}
7779
}
78-
countNotify++
79-
store.commit('SET_COUNT_NOTIFY', countNotify)
8080
if (originalPath === '/verify2FA' || originalPath === '/setup2FA') {
81+
countNotify++
82+
store.commit('SET_COUNT_NOTIFY', countNotify)
8183
notification.error({
8284
top: '65px',
8385
message: i18n.global.t('label.2FA'),
@@ -90,7 +92,9 @@ const err = (error) => {
9092
store.commit('SET_COUNT_NOTIFY', countNotify)
9193
}
9294
})
93-
} else {
95+
} else if (originalPath !== '/user/login') {
96+
countNotify++
97+
store.commit('SET_COUNT_NOTIFY', countNotify)
9498
notification.error({
9599
top: '65px',
96100
message: i18n.global.t('label.unauthorized'),

0 commit comments

Comments
 (0)