fix: set default redirect URLs for CAS, OAuth2, and OIDC configurations
This commit is contained in:
parent
b3fa1e559a
commit
7205c7fda7
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<el-button @click="submit(authFormRef)" type="primary" :disabled="loading"
|
<el-button @click="submit(authFormRef)" type="primary" :disabled="loading"
|
||||||
v-hasPermission="
|
v-hasPermission="
|
||||||
new ComplexPermission(
|
new ComplexPermission(
|
||||||
[RoleConst.ADMIN],
|
[RoleConst.ADMIN],
|
||||||
[PermissionConst.CHAT_USER_AUTH_EDIT],
|
[PermissionConst.CHAT_USER_AUTH_EDIT],
|
||||||
@ -64,8 +64,8 @@ import authApi from '@/api/chat-user/auth-setting'
|
|||||||
import type {FormInstance, FormRules} from 'element-plus'
|
import type {FormInstance, FormRules} from 'element-plus'
|
||||||
import {t} from '@/locales'
|
import {t} from '@/locales'
|
||||||
import {MsgSuccess} from '@/utils/message'
|
import {MsgSuccess} from '@/utils/message'
|
||||||
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
import {PermissionConst, RoleConst} from '@/utils/permission/data'
|
||||||
import { ComplexPermission } from '@/utils/permission/type'
|
import {ComplexPermission} from '@/utils/permission/type'
|
||||||
|
|
||||||
const form = ref<any>({
|
const form = ref<any>({
|
||||||
id: '',
|
id: '',
|
||||||
@ -125,6 +125,9 @@ function getDetail() {
|
|||||||
}
|
}
|
||||||
form.value = res.data
|
form.value = res.data
|
||||||
}
|
}
|
||||||
|
if (!form.value.config.redirectUrl) {
|
||||||
|
form.value.config.redirectUrl = window.location.origin + window.MaxKB.chatPrefix + '/api/auth/cas'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -208,6 +208,9 @@ function getDetail() {
|
|||||||
if (res.data && JSON.stringify(res.data) !== '{}') {
|
if (res.data && JSON.stringify(res.data) !== '{}') {
|
||||||
form.value = res.data
|
form.value = res.data
|
||||||
}
|
}
|
||||||
|
if (!form.value.config.redirectUrl) {
|
||||||
|
form.value.config.redirectUrl = window.location.origin + window.MaxKB.chatPrefix + '/api/auth/oauth2'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -219,6 +219,9 @@ function getDetail() {
|
|||||||
form.value.config.fieldMapping = '{"username": "preferred_username", "email": "email"}'
|
form.value.config.fieldMapping = '{"username": "preferred_username", "email": "email"}'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!form.value.config.redirectUrl) {
|
||||||
|
form.value.config.redirectUrl = window.location.origin + window.MaxKB.chatPrefix + '/api/auth/oidc'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -124,6 +124,9 @@ function getDetail() {
|
|||||||
res.data.config.validateUrl = res.data.config.ldpUri
|
res.data.config.validateUrl = res.data.config.ldpUri
|
||||||
}
|
}
|
||||||
form.value = res.data
|
form.value = res.data
|
||||||
|
if (!form.value.config.redirectUrl){
|
||||||
|
form.value.config.redirectUrl = window.location.origin + window.MaxKB.prefix + 'api/cas'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -208,6 +208,9 @@ function getDetail() {
|
|||||||
if (res.data && JSON.stringify(res.data) !== '{}') {
|
if (res.data && JSON.stringify(res.data) !== '{}') {
|
||||||
form.value = res.data
|
form.value = res.data
|
||||||
}
|
}
|
||||||
|
if (!form.value.config.redirectUrl){
|
||||||
|
form.value.config.redirectUrl = window.location.origin + window.MaxKB.prefix + 'api/oauth2'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -218,6 +218,9 @@ function getDetail() {
|
|||||||
) {
|
) {
|
||||||
form.value.config.fieldMapping = '{"username": "preferred_username", "email": "email"}'
|
form.value.config.fieldMapping = '{"username": "preferred_username", "email": "email"}'
|
||||||
}
|
}
|
||||||
|
if (!form.value.config.redirectUrl){
|
||||||
|
form.value.config.redirectUrl = window.location.origin + window.MaxKB.prefix + 'api/oidc'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
value="is_active"
|
value="is_active"
|
||||||
/>
|
/>
|
||||||
<el-option
|
<el-option
|
||||||
|
v-if="user.isEE() || user.isPE()"
|
||||||
:label="$t('views.userManage.source.label')"
|
:label="$t('views.userManage.source.label')"
|
||||||
value="source"
|
value="source"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user