支持设置linuxdo信任等级
This commit is contained in:
+28
-1
@@ -6340,6 +6340,7 @@ const RegistrationConfigComponent = ({
|
||||
OIDCClientId: string;
|
||||
OIDCClientSecret: string;
|
||||
OIDCButtonText: string;
|
||||
OIDCMinTrustLevel: number;
|
||||
}>({
|
||||
EnableRegistration: false,
|
||||
RegistrationRequireTurnstile: false,
|
||||
@@ -6356,6 +6357,7 @@ const RegistrationConfigComponent = ({
|
||||
OIDCClientId: '',
|
||||
OIDCClientSecret: '',
|
||||
OIDCButtonText: '',
|
||||
OIDCMinTrustLevel: 0,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
@@ -6376,6 +6378,7 @@ const RegistrationConfigComponent = ({
|
||||
OIDCClientId: config.SiteConfig.OIDCClientId || '',
|
||||
OIDCClientSecret: config.SiteConfig.OIDCClientSecret || '',
|
||||
OIDCButtonText: config.SiteConfig.OIDCButtonText || '',
|
||||
OIDCMinTrustLevel: config.SiteConfig.OIDCMinTrustLevel ?? 0,
|
||||
});
|
||||
}
|
||||
}, [config]);
|
||||
@@ -6934,7 +6937,31 @@ const RegistrationConfigComponent = ({
|
||||
className='w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-green-500 focus:border-transparent'
|
||||
/>
|
||||
<p className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
|
||||
自定义OIDC登录按钮显示的文字,如"使用企业账号登录"、"使用SSO登录"等。留空则显示默认文字"使用OIDC登录"
|
||||
自定义OIDC登录按钮显示的文字,如"使用企业账号登录"、"使用SSO登录"等。留空则显示默认文字"使用OIDC登录"
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* OIDC最低信任等级 */}
|
||||
<div>
|
||||
<label className='block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2'>
|
||||
最低信任等级
|
||||
</label>
|
||||
<input
|
||||
type='number'
|
||||
min='0'
|
||||
max='4'
|
||||
placeholder='0'
|
||||
value={registrationSettings.OIDCMinTrustLevel === 0 ? '' : registrationSettings.OIDCMinTrustLevel}
|
||||
onChange={(e) =>
|
||||
setRegistrationSettings((prev) => ({
|
||||
...prev,
|
||||
OIDCMinTrustLevel: e.target.value === '' ? 0 : parseInt(e.target.value),
|
||||
}))
|
||||
}
|
||||
className='w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-green-500 focus:border-transparent'
|
||||
/>
|
||||
<p className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
|
||||
仅LinuxDo网站有效。设置为0时不判断,1-4表示最低信任等级要求
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user