File tree 1 file changed +23
-0
lines changed
ui/src/views/authentication/component
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 61
61
show-password
62
62
/>
63
63
</el-form-item >
64
+ <el-form-item
65
+ :label =" $t('views.system.authentication.oauth2.filedMapping')"
66
+ prop =" config_data.fieldMapping"
67
+ >
68
+ <el-input
69
+ v-model =" form.config_data.fieldMapping"
70
+ :placeholder =" $t('views.system.authentication.oauth2.filedMappingPlaceholder')"
71
+ />
72
+ </el-form-item >
64
73
<el-form-item
65
74
:label =" $t('views.system.authentication.oidc.redirectUrl')"
66
75
prop =" config_data.redirectUrl"
@@ -104,6 +113,7 @@ const form = ref<any>({
104
113
state: ' ' ,
105
114
clientId: ' ' ,
106
115
clientSecret: ' ' ,
116
+ fieldMapping: ' {"username": "preferred_username", "email": "email"}' ,
107
117
redirectUrl: ' '
108
118
},
109
119
is_active: true
@@ -156,6 +166,13 @@ const rules = reactive<FormRules<any>>({
156
166
trigger: ' blur'
157
167
}
158
168
],
169
+ ' config_data.fieldMapping' : [
170
+ {
171
+ required: true ,
172
+ message: t (' views.system.authentication.oauth2.filedMappingPlaceholder' ),
173
+ trigger: ' blur'
174
+ }
175
+ ],
159
176
' config_data.redirectUrl' : [
160
177
{
161
178
required: true ,
@@ -187,6 +204,12 @@ function getDetail() {
187
204
authApi .getAuthSetting (form .value .auth_type , loading ).then ((res : any ) => {
188
205
if (res .data && JSON .stringify (res .data ) !== ' {}' ) {
189
206
form .value = res .data
207
+ if (
208
+ form .value .config_data .fieldMapping === ' ' ||
209
+ form .value .config_data .fieldMapping === undefined
210
+ ) {
211
+ form .value .config_data .fieldMapping = ' {"username": "preferred_username", "email": "email"}'
212
+ }
190
213
}
191
214
})
192
215
}
You can’t perform that action at this time.
0 commit comments