Skip to content

Commit 7205c7f

Browse files
committed
fix: set default redirect URLs for CAS, OAuth2, and OIDC configurations
1 parent b3fa1e5 commit 7205c7f

File tree

7 files changed

+22
-3
lines changed

7 files changed

+22
-3
lines changed

ui/src/views/system-chat-user/authentication/component/CAS.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
<div class="text-right">
4747
<el-button @click="submit(authFormRef)" type="primary" :disabled="loading"
48-
v-hasPermission="
48+
v-hasPermission="
4949
new ComplexPermission(
5050
[RoleConst.ADMIN],
5151
[PermissionConst.CHAT_USER_AUTH_EDIT],
@@ -64,8 +64,8 @@ import authApi from '@/api/chat-user/auth-setting'
6464
import type {FormInstance, FormRules} from 'element-plus'
6565
import {t} from '@/locales'
6666
import {MsgSuccess} from '@/utils/message'
67-
import { PermissionConst, RoleConst } from '@/utils/permission/data'
68-
import { ComplexPermission } from '@/utils/permission/type'
67+
import {PermissionConst, RoleConst} from '@/utils/permission/data'
68+
import {ComplexPermission} from '@/utils/permission/type'
6969
7070
const form = ref<any>({
7171
id: '',
@@ -125,6 +125,9 @@ function getDetail() {
125125
}
126126
form.value = res.data
127127
}
128+
if (!form.value.config.redirectUrl) {
129+
form.value.config.redirectUrl = window.location.origin + window.MaxKB.chatPrefix + '/api/auth/cas'
130+
}
128131
})
129132
}
130133

ui/src/views/system-chat-user/authentication/component/OAuth2.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ function getDetail() {
208208
if (res.data && JSON.stringify(res.data) !== '{}') {
209209
form.value = res.data
210210
}
211+
if (!form.value.config.redirectUrl) {
212+
form.value.config.redirectUrl = window.location.origin + window.MaxKB.chatPrefix + '/api/auth/oauth2'
213+
}
211214
})
212215
}
213216

ui/src/views/system-chat-user/authentication/component/OIDC.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ function getDetail() {
219219
form.value.config.fieldMapping = '{"username": "preferred_username", "email": "email"}'
220220
}
221221
}
222+
if (!form.value.config.redirectUrl) {
223+
form.value.config.redirectUrl = window.location.origin + window.MaxKB.chatPrefix + '/api/auth/oidc'
224+
}
222225
})
223226
}
224227

ui/src/views/system-setting/authentication/component/CAS.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ function getDetail() {
124124
res.data.config.validateUrl = res.data.config.ldpUri
125125
}
126126
form.value = res.data
127+
if (!form.value.config.redirectUrl){
128+
form.value.config.redirectUrl = window.location.origin + window.MaxKB.prefix + 'api/cas'
129+
}
127130
}
128131
})
129132
}

ui/src/views/system-setting/authentication/component/OAuth2.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ function getDetail() {
208208
if (res.data && JSON.stringify(res.data) !== '{}') {
209209
form.value = res.data
210210
}
211+
if (!form.value.config.redirectUrl){
212+
form.value.config.redirectUrl = window.location.origin + window.MaxKB.prefix + 'api/oauth2'
213+
}
211214
})
212215
}
213216

ui/src/views/system-setting/authentication/component/OIDC.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ function getDetail() {
218218
) {
219219
form.value.config.fieldMapping = '{"username": "preferred_username", "email": "email"}'
220220
}
221+
if (!form.value.config.redirectUrl){
222+
form.value.config.redirectUrl = window.location.origin + window.MaxKB.prefix + 'api/oidc'
223+
}
221224
}
222225
})
223226
}

ui/src/views/system/user-manage/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
value="is_active"
2525
/>
2626
<el-option
27+
v-if="user.isEE() || user.isPE()"
2728
:label="$t('views.userManage.source.label')"
2829
value="source"
2930
/>

0 commit comments

Comments
 (0)