Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions apps/portal/serializers/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,8 @@ def _enrich_auth_config(self, auth_config):

options = [{"label": _(_type), "value": _type} for _type in all_available_auths]
options.sort(key=lambda x: (0 if x["value"] == "LOCAL" else 1, x["label"]))
auth_types = [{"label": _(_type), "value": _type} for _type in auth_config["login_value"]]
auth_types.sort(key=lambda x: (0 if x["value"] == "LOCAL" else 1, x["label"]))

auth_config["system_options"] = options
auth_config["auth_types"] = auth_types
return auth_config

def one(self):
Expand Down
1 change: 0 additions & 1 deletion ui/src/api/types/portal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export interface PortalAuthConfig extends Dict<unknown> {
failed_attempts?: number
lock_time?: number
system_options?: OptionItem<string>[]
auth_types?: OptionItem<string>[]
}

export interface PortalSetting {
Expand Down
2 changes: 0 additions & 2 deletions ui/src/api/types/system-authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ export interface AuthProviderSettingPayload {
}

export interface LoginAuthSettingPayload {
auth_types?: OptionItem[]
default_value: string
failed_attempts: number
group_id?: string
lock_time: number
login_methods: string[]
max_attempts: number
permission?: string
role_id?: string
system_options?: OptionItem[]
workspace_id?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const loginSettingFields = [
'lock_time',
'role_id',
'workspace_id',
'permission',
'group_id',
] as const
const form = reactive<Omit<LoginAuthSettingPayload, 'system_options'>>({
login_methods: [LOGIN_METHOD.LOCAL],
Expand All @@ -33,7 +33,7 @@ const form = reactive<Omit<LoginAuthSettingPayload, 'system_options'>>({
lock_time: 10,
role_id: ROLE_TYPE.USER,
workspace_id: 'default',
permission: 'NOT_AUTH',
group_id: undefined,
})
const rules: FormRules<LoginAuthSettingPayload> = {
default_value: [{ required: true, message: '请选择默认登录方式', trigger: 'change' }],
Expand All @@ -52,7 +52,7 @@ function loadSetting() {
return AuthSettingApi.getLoginSetting()
.then((setting) => {
loginMethodOptions.value = setting.system_options ?? []
Object.assign(form, pick(setting, [...loginSettingFields, 'group_id']))
Object.assign(form, pick(setting, loginSettingFields))
})
.finally(() => {
loading.value = false
Expand Down
Loading