forked from baron/baron-sso
feat: 커스텀 필드 기반 로그인 ID 연동 기능 추가 (#440)
- Kratos Identity 스키마에 로그인 전용 `id` 속성 추가 - 테넌트 Config의 `loginIdField` 설정에 따라 User의 `login_id` 및 Kratos `traits.id` 동기화 로직 구현 - Admin UI 테넌트 스키마 설정 내 '로그인 ID로 사용' 체크박스 추가 - Admin UI 사용자 생성/수정/조회 화면에 로그인 ID 관리 필드 및 컬럼 반영 - Userfront 로그인 화면 접속 시 테넌트 설정에 따라 동적 로그인 ID 라벨 적용 - 관련 다국어(ko/en) 번역 추가 및 로그인 ID 설계 문서 업데이트
This commit is contained in:
@@ -48,6 +48,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
||||
String? _redirectUrl;
|
||||
String? _loginChallenge;
|
||||
bool _isPasswordCapsLockOn = false;
|
||||
String? _loginIdLabel;
|
||||
|
||||
// QR Login Variables
|
||||
String? _qrImageBase64;
|
||||
@@ -150,6 +151,19 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
||||
if (!_verificationOnly) {
|
||||
await _attemptOidcAutoAccept();
|
||||
if (!mounted) return;
|
||||
|
||||
// Fetch Tenant Info to check for custom login ID label
|
||||
try {
|
||||
final info = await AuthProxyService.getTenantInfo();
|
||||
if (info['loginIdLabel'] != null) {
|
||||
setState(() {
|
||||
_loginIdLabel = info['loginIdLabel'];
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
debugPrint("[Auth] Failed to fetch tenant info: $e");
|
||||
}
|
||||
|
||||
// login_challenge 흐름에서는 auto-accept에서 이미 쿠키 세션까지 확인하므로
|
||||
// 동일 프레임에서 중복 체크를 피합니다.
|
||||
if (!_hasLoginChallenge) {
|
||||
@@ -1456,7 +1470,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
||||
),
|
||||
controller: _passwordLoginIdController,
|
||||
decoration: InputDecoration(
|
||||
labelText: tr(
|
||||
labelText: _loginIdLabel ?? tr(
|
||||
'ui.userfront.login.field.login_id',
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
|
||||
Reference in New Issue
Block a user