forked from baron/baron-sso
로그인 승인 페이지 UI/UX 수정
This commit is contained in:
@@ -805,7 +805,7 @@ body = "We could not find an account for that information.\\\\\\\\\\\\\\\\nPleas
|
|||||||
[msg.userfront.login.verification]
|
[msg.userfront.login.verification]
|
||||||
approved = "Approved. Complete sign-in in the original window."
|
approved = "Approved. Complete sign-in in the original window."
|
||||||
approved_local = "Approved. This device is already signed in, and the remote window will be signed in shortly."
|
approved_local = "Approved. This device is already signed in, and the remote window will be signed in shortly."
|
||||||
approved_remote = "Your requested sign-in is complete."
|
approved_remote = "Approved.\nPlease return to the screen where you requested sign-in."
|
||||||
pending_remote = "Checking the sign-in approval request. Please wait."
|
pending_remote = "Checking the sign-in approval request. Please wait."
|
||||||
success = "Sign-in approval completed."
|
success = "Sign-in approval completed."
|
||||||
|
|
||||||
@@ -2528,12 +2528,11 @@ title = "Account not found"
|
|||||||
|
|
||||||
[ui.userfront.login.verification]
|
[ui.userfront.login.verification]
|
||||||
action_label = "Done"
|
action_label = "Done"
|
||||||
action_label_remote = "Go to sign-in window"
|
|
||||||
action_label_close = "Close Window"
|
action_label_close = "Close Window"
|
||||||
page_title = "Sign-in approval"
|
page_title = "Baron SW Portal"
|
||||||
title = "Approval complete"
|
title = "Approval complete"
|
||||||
title_pending = "Checking approval"
|
title_pending = "Checking approval"
|
||||||
title_remote = "Sign-in approved"
|
title_remote = "Sign-in Approved"
|
||||||
|
|
||||||
[ui.shell.nav]
|
[ui.shell.nav]
|
||||||
logout = "Logout"
|
logout = "Logout"
|
||||||
|
|||||||
@@ -1296,7 +1296,7 @@ body = "가입되지 않은 정보입니다.\\\\n회원가입 후 이용해 주
|
|||||||
[msg.userfront.login.verification]
|
[msg.userfront.login.verification]
|
||||||
approved = "승인되었습니다. 로그인은 요청하신 창에서 완료됩니다."
|
approved = "승인되었습니다. 로그인은 요청하신 창에서 완료됩니다."
|
||||||
approved_local = "승인 되었습니다. 이 기기는 로그인되어 있는 상태입니다. 원격 창도 로그인이 될 예정입니다"
|
approved_local = "승인 되었습니다. 이 기기는 로그인되어 있는 상태입니다. 원격 창도 로그인이 될 예정입니다"
|
||||||
approved_remote = "요청하신 로그인이 완료되었습니다"
|
approved_remote = "승인되었습니다.\n로그인 요청하신 화면으로 돌아가주세요."
|
||||||
pending_remote = "승인 요청을 확인하고 있습니다. 잠시만 기다려 주세요."
|
pending_remote = "승인 요청을 확인하고 있습니다. 잠시만 기다려 주세요."
|
||||||
success = "로그인 승인에 성공했습니다."
|
success = "로그인 승인에 성공했습니다."
|
||||||
|
|
||||||
@@ -2953,8 +2953,7 @@ title = "미등록 회원"
|
|||||||
|
|
||||||
[ui.userfront.login.verification]
|
[ui.userfront.login.verification]
|
||||||
action_label = "확인"
|
action_label = "확인"
|
||||||
action_label_remote = "로그인 창으로 이동하기"
|
page_title = "Baron SW 포탈"
|
||||||
page_title = "로그인 승인"
|
|
||||||
title = "승인 완료"
|
title = "승인 완료"
|
||||||
action_label_close = "창 닫기"
|
action_label_close = "창 닫기"
|
||||||
title_pending = "로그인 승인 확인 중"
|
title_pending = "로그인 승인 확인 중"
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ body = "We could not find an account for that information.\\\\\\\\\\\\\\\\nPleas
|
|||||||
[msg.userfront.login.verification]
|
[msg.userfront.login.verification]
|
||||||
approved = "Approved. Complete sign-in in the original window."
|
approved = "Approved. Complete sign-in in the original window."
|
||||||
approved_local = "Approved. This device is already signed in, and the remote window will be signed in shortly."
|
approved_local = "Approved. This device is already signed in, and the remote window will be signed in shortly."
|
||||||
approved_remote = "Your requested sign-in is complete."
|
approved_remote = "Approved.\nPlease return to the screen where you requested sign-in."
|
||||||
pending_remote = "Checking the sign-in approval request. Please wait."
|
pending_remote = "Checking the sign-in approval request. Please wait."
|
||||||
success = "Sign-in approval completed."
|
success = "Sign-in approval completed."
|
||||||
|
|
||||||
@@ -582,12 +582,11 @@ title = "Account not found"
|
|||||||
|
|
||||||
[ui.userfront.login.verification]
|
[ui.userfront.login.verification]
|
||||||
action_label = "Done"
|
action_label = "Done"
|
||||||
action_label_remote = "Go to sign-in window"
|
|
||||||
action_label_close = "Close Window"
|
action_label_close = "Close Window"
|
||||||
page_title = "Sign-in approval"
|
page_title = "Baron SW Portal"
|
||||||
title = "Approval complete"
|
title = "Approval complete"
|
||||||
title_pending = "Checking approval"
|
title_pending = "Checking approval"
|
||||||
title_remote = "Sign-in approved"
|
title_remote = "Sign-in Approved"
|
||||||
|
|
||||||
[ui.userfront.login_success]
|
[ui.userfront.login_success]
|
||||||
later = "Do this later (go to dashboard)"
|
later = "Do this later (go to dashboard)"
|
||||||
|
|||||||
@@ -455,7 +455,7 @@ body = "가입되지 않은 정보입니다.\\\\n회원가입 후 이용해 주
|
|||||||
[msg.userfront.login.verification]
|
[msg.userfront.login.verification]
|
||||||
approved = "승인되었습니다. 로그인은 요청하신 창에서 완료됩니다."
|
approved = "승인되었습니다. 로그인은 요청하신 창에서 완료됩니다."
|
||||||
approved_local = "승인 되었습니다. 이 기기는 로그인되어 있는 상태입니다. 원격 창도 로그인이 될 예정입니다"
|
approved_local = "승인 되었습니다. 이 기기는 로그인되어 있는 상태입니다. 원격 창도 로그인이 될 예정입니다"
|
||||||
approved_remote = "요청하신 로그인이 완료되었습니다"
|
approved_remote = "승인되었습니다.\n로그인 요청하신 화면으로 돌아가주세요."
|
||||||
pending_remote = "승인 요청을 확인하고 있습니다. 잠시만 기다려 주세요."
|
pending_remote = "승인 요청을 확인하고 있습니다. 잠시만 기다려 주세요."
|
||||||
success = "로그인 승인에 성공했습니다."
|
success = "로그인 승인에 성공했습니다."
|
||||||
|
|
||||||
@@ -804,8 +804,7 @@ title = "미등록 회원"
|
|||||||
|
|
||||||
[ui.userfront.login.verification]
|
[ui.userfront.login.verification]
|
||||||
action_label = "확인"
|
action_label = "확인"
|
||||||
action_label_remote = "로그인 창으로 이동하기"
|
page_title = "Baron SW 포탈"
|
||||||
page_title = "로그인 승인"
|
|
||||||
title = "승인 완료"
|
title = "승인 완료"
|
||||||
action_label_close = "창 닫기"
|
action_label_close = "창 닫기"
|
||||||
title_pending = "로그인 승인 확인 중"
|
title_pending = "로그인 승인 확인 중"
|
||||||
|
|||||||
@@ -79,14 +79,10 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
bool _verificationApproved = false;
|
bool _verificationApproved = false;
|
||||||
bool _dismissedOverlays = false;
|
bool _dismissedOverlays = false;
|
||||||
bool _localNavigationCompleted = false;
|
bool _localNavigationCompleted = false;
|
||||||
String _verificationMessage = '';
|
String? _verificationMessageKey;
|
||||||
String _verificationTitle = tr('ui.userfront.login.verification.title');
|
String _verificationTitleKey = 'ui.userfront.login.verification.title';
|
||||||
String _verificationPageTitle = tr(
|
String _verificationPageTitleKey =
|
||||||
'ui.userfront.login.verification.page_title',
|
'ui.userfront.login.verification.page_title';
|
||||||
);
|
|
||||||
String _verificationActionLabel = tr(
|
|
||||||
'ui.userfront.login.verification.action_label',
|
|
||||||
);
|
|
||||||
Timer? _verificationRedirectTimer;
|
Timer? _verificationRedirectTimer;
|
||||||
bool _noticeHandled = false;
|
bool _noticeHandled = false;
|
||||||
bool _drySendEnabled = false;
|
bool _drySendEnabled = false;
|
||||||
@@ -144,12 +140,9 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
|
|
||||||
if (widget.verificationCompleteOnly) {
|
if (widget.verificationCompleteOnly) {
|
||||||
_markVerificationApproved(
|
_markVerificationApproved(
|
||||||
tr('msg.userfront.login.verification.approved_remote'),
|
'msg.userfront.login.verification.approved_remote',
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
titleKey: 'ui.userfront.login.verification.title_remote',
|
||||||
actionLabel: tr(
|
onAction: _closeVerificationWindowIfPossible,
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -810,30 +803,25 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _markVerificationApproved(
|
void _markVerificationApproved(
|
||||||
String message, {
|
String messageKey, {
|
||||||
String? title,
|
String? titleKey,
|
||||||
String? pageTitle,
|
String? pageTitleKey,
|
||||||
String? actionLabel,
|
|
||||||
String actionPath = '/',
|
String actionPath = '/',
|
||||||
bool autoRedirect = false,
|
bool autoRedirect = false,
|
||||||
Duration redirectDelay = const Duration(seconds: 2),
|
Duration redirectDelay = const Duration(seconds: 2),
|
||||||
VoidCallback? onAction,
|
VoidCallback? onAction,
|
||||||
}) {
|
}) {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
final resolvedTitle = title ?? tr('ui.userfront.login.verification.title');
|
|
||||||
final resolvedPageTitle =
|
|
||||||
pageTitle ?? tr('ui.userfront.login.verification.page_title');
|
|
||||||
final resolvedActionLabel =
|
|
||||||
actionLabel ?? tr('ui.userfront.login.verification.action_label');
|
|
||||||
if (_moveVerificationOnlyResultToCleanRoute()) {
|
if (_moveVerificationOnlyResultToCleanRoute()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
_verificationApproved = true;
|
_verificationApproved = true;
|
||||||
_verificationMessage = message;
|
_verificationMessageKey = messageKey;
|
||||||
_verificationTitle = resolvedTitle;
|
_verificationTitleKey =
|
||||||
_verificationPageTitle = resolvedPageTitle;
|
titleKey ?? 'ui.userfront.login.verification.title';
|
||||||
_verificationActionLabel = resolvedActionLabel;
|
_verificationPageTitleKey =
|
||||||
|
pageTitleKey ?? 'ui.userfront.login.verification.page_title';
|
||||||
_onVerificationAction = onAction;
|
_onVerificationAction = onAction;
|
||||||
});
|
});
|
||||||
_verificationRedirectTimer?.cancel();
|
_verificationRedirectTimer?.cancel();
|
||||||
@@ -861,89 +849,195 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _moveToSigninOrCloseVerificationWindow() {
|
void _handleVerificationResultPrimaryAction() {
|
||||||
if (webWindow.hasOpener()) {
|
if (_onVerificationAction != null) {
|
||||||
webWindow.close();
|
_runVerificationExitAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
context.go(buildLocalizedSigninPath(Uri.base));
|
if (_verificationOnly) {
|
||||||
|
_closeVerificationWindowIfPossible();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final hasLocalSession =
|
||||||
|
(AuthTokenStore.getToken()?.isNotEmpty ?? false) ||
|
||||||
|
AuthTokenStore.usesCookie();
|
||||||
|
final target = hasLocalSession
|
||||||
|
? buildLocalizedHomePath(Uri.base)
|
||||||
|
: buildLocalizedSigninPath(Uri.base);
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {
|
||||||
|
_verificationOnly = false;
|
||||||
|
_verificationApproved = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
context.go(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _markRemoteVerificationApproved() {
|
||||||
|
_markVerificationApproved(
|
||||||
|
'msg.userfront.login.verification.approved_remote',
|
||||||
|
titleKey: 'ui.userfront.login.verification.title_remote',
|
||||||
|
onAction: _closeVerificationWindowIfPossible,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildVerificationResultView() {
|
Widget _buildVerificationResultView() {
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
final theme = Theme.of(context);
|
||||||
return Center(
|
final colorScheme = theme.colorScheme;
|
||||||
|
final accentColor = colorScheme.brightness == Brightness.dark
|
||||||
|
? const Color(0xFF93C5FD)
|
||||||
|
: const Color(0xFF1E3A8A);
|
||||||
|
final message = tr(
|
||||||
|
_verificationMessageKey ?? 'msg.userfront.login.verification.success',
|
||||||
|
);
|
||||||
|
final verificationTitle = tr(_verificationTitleKey);
|
||||||
|
final closeHint = tr('msg.userfront.login.verification.close_hint');
|
||||||
|
final showCloseHint = _onVerificationAction != null || _verificationOnly;
|
||||||
|
final actionLabelKey = showCloseHint
|
||||||
|
? 'ui.userfront.login.verification.action_label_close'
|
||||||
|
: 'ui.userfront.login.verification.action_label';
|
||||||
|
final actionIcon = showCloseHint
|
||||||
|
? Icons.close_rounded
|
||||||
|
: Icons.arrow_forward_rounded;
|
||||||
|
|
||||||
|
return SafeArea(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(24.0),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 32),
|
||||||
child: ConstrainedBox(
|
child: Center(
|
||||||
constraints: const BoxConstraints(maxWidth: 420),
|
child: ConstrainedBox(
|
||||||
child: Material(
|
constraints: const BoxConstraints(maxWidth: 468),
|
||||||
color: colorScheme.surface,
|
child: LayoutBuilder(
|
||||||
elevation: 12,
|
builder: (context, constraints) {
|
||||||
shadowColor: Colors.black.withValues(alpha: 0.18),
|
final isCompact = constraints.maxWidth < 360;
|
||||||
borderRadius: BorderRadius.circular(24),
|
final iconBoxSize = isCompact ? 76.0 : 88.0;
|
||||||
child: Padding(
|
final iconSize = isCompact ? 48.0 : 56.0;
|
||||||
padding: const EdgeInsets.fromLTRB(24, 28, 24, 24),
|
final verticalGap = isCompact ? 16.0 : 20.0;
|
||||||
child: Column(
|
final controlsOffset = isCompact ? 150.0 : 170.0;
|
||||||
mainAxisSize: MainAxisSize.min,
|
final cardRadius = isCompact ? 24.0 : 28.0;
|
||||||
children: [
|
final cardPadding = isCompact
|
||||||
Icon(
|
? const EdgeInsets.fromLTRB(20, 24, 20, 22)
|
||||||
Icons.check_circle_outline,
|
: const EdgeInsets.fromLTRB(30, 34, 30, 28);
|
||||||
color: colorScheme.primary,
|
|
||||||
size: 72,
|
return Column(
|
||||||
),
|
mainAxisSize: MainAxisSize.min,
|
||||||
const SizedBox(height: 16),
|
children: [
|
||||||
Text(
|
SizedBox(height: controlsOffset),
|
||||||
_verificationTitle,
|
DecoratedBox(
|
||||||
textAlign: TextAlign.center,
|
decoration: BoxDecoration(
|
||||||
style: TextStyle(
|
color: colorScheme.surface,
|
||||||
fontSize: 22,
|
borderRadius: BorderRadius.circular(cardRadius),
|
||||||
fontWeight: FontWeight.bold,
|
border: Border.all(
|
||||||
color: colorScheme.onSurface,
|
color: colorScheme.outlineVariant.withValues(
|
||||||
),
|
alpha: 0.7,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
),
|
||||||
Text(
|
boxShadow: [
|
||||||
_verificationMessage.isEmpty
|
BoxShadow(
|
||||||
? tr('msg.userfront.login.verification.success')
|
color: colorScheme.shadow.withValues(alpha: 0.08),
|
||||||
: _verificationMessage,
|
blurRadius: 28,
|
||||||
textAlign: TextAlign.center,
|
offset: const Offset(0, 16),
|
||||||
style: TextStyle(color: colorScheme.onSurfaceVariant),
|
),
|
||||||
),
|
],
|
||||||
const SizedBox(height: 24),
|
),
|
||||||
SizedBox(
|
child: Padding(
|
||||||
width: double.infinity,
|
padding: cardPadding,
|
||||||
child: FilledButton(
|
child: Column(
|
||||||
onPressed: () {
|
mainAxisSize: MainAxisSize.min,
|
||||||
if (_onVerificationAction != null) {
|
children: [
|
||||||
_runVerificationExitAction();
|
Container(
|
||||||
return;
|
width: iconBoxSize,
|
||||||
}
|
height: iconBoxSize,
|
||||||
if (_verificationOnly) {
|
decoration: BoxDecoration(
|
||||||
_closeVerificationWindowIfPossible();
|
shape: BoxShape.circle,
|
||||||
return;
|
gradient: LinearGradient(
|
||||||
}
|
colors: [
|
||||||
final hasLocalSession =
|
colorScheme.primary.withValues(alpha: 0.18),
|
||||||
(AuthTokenStore.getToken()?.isNotEmpty ?? false) ||
|
colorScheme.tertiary.withValues(
|
||||||
AuthTokenStore.usesCookie();
|
alpha: 0.14,
|
||||||
final target = hasLocalSession
|
),
|
||||||
? buildLocalizedHomePath(Uri.base)
|
],
|
||||||
: buildLocalizedSigninPath(Uri.base);
|
begin: Alignment.topLeft,
|
||||||
if (mounted) {
|
end: Alignment.bottomRight,
|
||||||
setState(() {
|
),
|
||||||
_verificationOnly = false;
|
),
|
||||||
_verificationApproved = false;
|
alignment: Alignment.center,
|
||||||
});
|
child: Icon(
|
||||||
}
|
Icons.person,
|
||||||
context.go(target);
|
size: iconSize,
|
||||||
},
|
color: colorScheme.primary,
|
||||||
child: Text(
|
),
|
||||||
_verificationActionLabel,
|
),
|
||||||
textAlign: TextAlign.center,
|
SizedBox(height: verticalGap),
|
||||||
|
Text(
|
||||||
|
verificationTitle,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
softWrap: true,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: isCompact ? 22 : 26,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
color: accentColor,
|
||||||
|
letterSpacing: -0.4,
|
||||||
|
height: 1.25,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Text(
|
||||||
|
message,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
softWrap: true,
|
||||||
|
style:
|
||||||
|
(isCompact
|
||||||
|
? theme.textTheme.bodyMedium
|
||||||
|
: theme.textTheme.bodyLarge)
|
||||||
|
?.copyWith(
|
||||||
|
height: 1.6,
|
||||||
|
color: colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 24),
|
||||||
|
Center(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(
|
||||||
|
minWidth: 180,
|
||||||
|
maxWidth: 320,
|
||||||
|
),
|
||||||
|
child: SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: FilledButton.icon(
|
||||||
|
onPressed:
|
||||||
|
_handleVerificationResultPrimaryAction,
|
||||||
|
icon: Icon(actionIcon),
|
||||||
|
label: Text(tr(actionLabelKey)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (showCloseHint) ...[
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Text(
|
||||||
|
closeHint,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
softWrap: true,
|
||||||
|
style: theme.textTheme.bodyMedium?.copyWith(
|
||||||
|
height: 1.5,
|
||||||
|
color: colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 18),
|
||||||
],
|
Wrap(
|
||||||
),
|
alignment: WrapAlignment.center,
|
||||||
|
spacing: 10,
|
||||||
|
runSpacing: 10,
|
||||||
|
children: [ThemeToggleButton(), LanguageSelector()],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -985,7 +1079,13 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
title: Text(_verificationPageTitle),
|
title: Text(tr(_verificationPageTitleKey)),
|
||||||
|
leading: _verificationApproved && _onVerificationAction != null
|
||||||
|
? IconButton(
|
||||||
|
icon: const Icon(Icons.close),
|
||||||
|
onPressed: _runVerificationExitAction,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
actions: const [ThemeToggleButton(compact: true)],
|
actions: const [ThemeToggleButton(compact: true)],
|
||||||
),
|
),
|
||||||
body: _verificationApproved
|
body: _verificationApproved
|
||||||
@@ -996,13 +1096,6 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
|
|
||||||
Future<void> _verifyToken(String token) async {
|
Future<void> _verifyToken(String token) async {
|
||||||
debugPrint("[Auth] Starting verification for token: $token");
|
debugPrint("[Auth] Starting verification for token: $token");
|
||||||
final approvedMessage = tr('msg.userfront.login.verification.approved');
|
|
||||||
final remoteApprovedMessage = tr(
|
|
||||||
'msg.userfront.login.verification.approved_remote',
|
|
||||||
);
|
|
||||||
final localSessionMessage = tr(
|
|
||||||
'msg.userfront.login.verification.approved_local',
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
// Use Backend to verify the token (Backend-Driven Flow)
|
// Use Backend to verify the token (Backend-Driven Flow)
|
||||||
final res = await AuthProxyService.verifyMagicLink(
|
final res = await AuthProxyService.verifyMagicLink(
|
||||||
@@ -1019,14 +1112,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
|
|
||||||
if (status == 'approved' || (jwt == null && _verificationOnly)) {
|
if (status == 'approved' || (jwt == null && _verificationOnly)) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
_markVerificationApproved(
|
_markRemoteVerificationApproved();
|
||||||
remoteApprovedMessage,
|
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
|
||||||
actionLabel: tr(
|
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1034,7 +1120,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
if (jwt is String && jwt.isNotEmpty) {
|
if (jwt is String && jwt.isNotEmpty) {
|
||||||
if (hasLocalSession) {
|
if (hasLocalSession) {
|
||||||
_markVerificationApproved(
|
_markVerificationApproved(
|
||||||
localSessionMessage,
|
'msg.userfront.login.verification.approved_local',
|
||||||
actionPath: actionPath,
|
actionPath: actionPath,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -1044,7 +1130,10 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
_markVerificationApproved(approvedMessage, actionPath: actionPath);
|
_markVerificationApproved(
|
||||||
|
'msg.userfront.login.verification.approved',
|
||||||
|
actionPath: actionPath,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint("[Auth] Verification FAILED for token: $token. Error: $e");
|
debugPrint("[Auth] Verification FAILED for token: $token. Error: $e");
|
||||||
@@ -1055,14 +1144,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
errorStr.contains('already_verified') ||
|
errorStr.contains('already_verified') ||
|
||||||
errorStr.contains('session_active')) {
|
errorStr.contains('session_active')) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
_markVerificationApproved(
|
_markRemoteVerificationApproved();
|
||||||
remoteApprovedMessage,
|
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
|
||||||
actionLabel: tr(
|
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1087,12 +1169,6 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
debugPrint(
|
debugPrint(
|
||||||
"[Auth] Starting code verification for loginId: $sanitizedLoginId",
|
"[Auth] Starting code verification for loginId: $sanitizedLoginId",
|
||||||
);
|
);
|
||||||
final remoteApprovedMessage = tr(
|
|
||||||
'msg.userfront.login.verification.approved_remote',
|
|
||||||
);
|
|
||||||
final localSessionMessage = tr(
|
|
||||||
'msg.userfront.login.verification.approved_local',
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
final res = await AuthProxyService.verifyLoginCode(
|
final res = await AuthProxyService.verifyLoginCode(
|
||||||
sanitizedLoginId,
|
sanitizedLoginId,
|
||||||
@@ -1112,14 +1188,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
|
|
||||||
if (jwt == null && status == 'approved') {
|
if (jwt == null && status == 'approved') {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
_markVerificationApproved(
|
_markRemoteVerificationApproved();
|
||||||
remoteApprovedMessage,
|
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
|
||||||
actionLabel: tr(
|
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1127,20 +1196,13 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
if (jwt is String && jwt.isNotEmpty) {
|
if (jwt is String && jwt.isNotEmpty) {
|
||||||
if (hasLocalSession) {
|
if (hasLocalSession) {
|
||||||
_markVerificationApproved(
|
_markVerificationApproved(
|
||||||
localSessionMessage,
|
'msg.userfront.login.verification.approved_local',
|
||||||
actionPath: actionPath,
|
actionPath: actionPath,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_verificationOnly) {
|
if (_verificationOnly) {
|
||||||
_markVerificationApproved(
|
_markRemoteVerificationApproved();
|
||||||
remoteApprovedMessage,
|
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
|
||||||
actionLabel: tr(
|
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_onLoginSuccess(jwt, provider: res['provider'] as String?);
|
_onLoginSuccess(jwt, provider: res['provider'] as String?);
|
||||||
@@ -1148,14 +1210,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_verificationOnly && mounted) {
|
if (_verificationOnly && mounted) {
|
||||||
_markVerificationApproved(
|
_markRemoteVerificationApproved();
|
||||||
remoteApprovedMessage,
|
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
|
||||||
actionLabel: tr(
|
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint(
|
debugPrint(
|
||||||
@@ -1168,14 +1223,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
errorStr.contains('already_verified') ||
|
errorStr.contains('already_verified') ||
|
||||||
errorStr.contains('session_active')) {
|
errorStr.contains('session_active')) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
_markVerificationApproved(
|
_markRemoteVerificationApproved();
|
||||||
remoteApprovedMessage,
|
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
|
||||||
actionLabel: tr(
|
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1195,12 +1243,6 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
final sanitized = shortCode.trim().toUpperCase();
|
final sanitized = shortCode.trim().toUpperCase();
|
||||||
if (sanitized.isEmpty) return;
|
if (sanitized.isEmpty) return;
|
||||||
debugPrint("[Auth] Starting short code verification for code: $sanitized");
|
debugPrint("[Auth] Starting short code verification for code: $sanitized");
|
||||||
final remoteApprovedMessage = tr(
|
|
||||||
'msg.userfront.login.verification.approved_remote',
|
|
||||||
);
|
|
||||||
final localSessionMessage = tr(
|
|
||||||
'msg.userfront.login.verification.approved_local',
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
final res = await AuthProxyService.verifyLoginShortCode(
|
final res = await AuthProxyService.verifyLoginShortCode(
|
||||||
sanitized,
|
sanitized,
|
||||||
@@ -1216,14 +1258,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
|
|
||||||
if (jwt == null && status == 'approved') {
|
if (jwt == null && status == 'approved') {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
_markVerificationApproved(
|
_markRemoteVerificationApproved();
|
||||||
remoteApprovedMessage,
|
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
|
||||||
actionLabel: tr(
|
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1231,20 +1266,13 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
if (jwt is String && jwt.isNotEmpty) {
|
if (jwt is String && jwt.isNotEmpty) {
|
||||||
if (hasLocalSession) {
|
if (hasLocalSession) {
|
||||||
_markVerificationApproved(
|
_markVerificationApproved(
|
||||||
localSessionMessage,
|
'msg.userfront.login.verification.approved_local',
|
||||||
actionPath: actionPath,
|
actionPath: actionPath,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_verificationOnly) {
|
if (_verificationOnly) {
|
||||||
_markVerificationApproved(
|
_markRemoteVerificationApproved();
|
||||||
remoteApprovedMessage,
|
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
|
||||||
actionLabel: tr(
|
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_onLoginSuccess(jwt, provider: res['provider'] as String?);
|
_onLoginSuccess(jwt, provider: res['provider'] as String?);
|
||||||
@@ -1252,14 +1280,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_verificationOnly && mounted) {
|
if (_verificationOnly && mounted) {
|
||||||
_markVerificationApproved(
|
_markRemoteVerificationApproved();
|
||||||
remoteApprovedMessage,
|
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
|
||||||
actionLabel: tr(
|
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint("[Auth] Short code verification FAILED. Error: $e");
|
debugPrint("[Auth] Short code verification FAILED. Error: $e");
|
||||||
@@ -1270,14 +1291,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
errorStr.contains('already_verified') ||
|
errorStr.contains('already_verified') ||
|
||||||
errorStr.contains('session_active')) {
|
errorStr.contains('session_active')) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
_markVerificationApproved(
|
_markRemoteVerificationApproved();
|
||||||
remoteApprovedMessage,
|
|
||||||
title: tr('ui.userfront.login.verification.title_remote'),
|
|
||||||
actionLabel: tr(
|
|
||||||
'ui.userfront.login.verification.action_label_remote',
|
|
||||||
),
|
|
||||||
onAction: _moveToSigninOrCloseVerificationWindow,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2355,7 +2369,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
const Wrap(
|
Wrap(
|
||||||
alignment: WrapAlignment.center,
|
alignment: WrapAlignment.center,
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
runSpacing: 10,
|
runSpacing: 10,
|
||||||
|
|||||||
@@ -730,7 +730,8 @@ const Map<String, String> koStrings = {
|
|||||||
"msg.userfront.login.verification.approved": "승인되었습니다. 로그인은 요청하신 창에서 완료됩니다.",
|
"msg.userfront.login.verification.approved": "승인되었습니다. 로그인은 요청하신 창에서 완료됩니다.",
|
||||||
"msg.userfront.login.verification.approved_local":
|
"msg.userfront.login.verification.approved_local":
|
||||||
"승인 되었습니다. 이 기기는 로그인되어 있는 상태입니다. 원격 창도 로그인이 될 예정입니다",
|
"승인 되었습니다. 이 기기는 로그인되어 있는 상태입니다. 원격 창도 로그인이 될 예정입니다",
|
||||||
"msg.userfront.login.verification.approved_remote": "요청하신 로그인이 완료되었습니다",
|
"msg.userfront.login.verification.approved_remote":
|
||||||
|
"승인되었습니다.\n로그인 요청하신 화면으로 돌아가주세요.",
|
||||||
"msg.userfront.login.verification.pending_remote":
|
"msg.userfront.login.verification.pending_remote":
|
||||||
"승인 요청을 확인하고 있습니다. 잠시만 기다려 주세요.",
|
"승인 요청을 확인하고 있습니다. 잠시만 기다려 주세요.",
|
||||||
"msg.userfront.login.verification.success": "로그인 승인에 성공했습니다.",
|
"msg.userfront.login.verification.success": "로그인 승인에 성공했습니다.",
|
||||||
@@ -2197,8 +2198,7 @@ const Map<String, String> koStrings = {
|
|||||||
"ui.userfront.login.unregistered.title": "미등록 회원",
|
"ui.userfront.login.unregistered.title": "미등록 회원",
|
||||||
"ui.userfront.login.verification.action_label": "확인",
|
"ui.userfront.login.verification.action_label": "확인",
|
||||||
"ui.userfront.login.verification.action_label_close": "창 닫기",
|
"ui.userfront.login.verification.action_label_close": "창 닫기",
|
||||||
"ui.userfront.login.verification.action_label_remote": "로그인 창으로 이동하기",
|
"ui.userfront.login.verification.page_title": "Baron SW 포탈",
|
||||||
"ui.userfront.login.verification.page_title": "로그인 승인",
|
|
||||||
"ui.userfront.login.verification.title": "승인 완료",
|
"ui.userfront.login.verification.title": "승인 완료",
|
||||||
"ui.userfront.login.verification.title_pending": "로그인 승인 확인 중",
|
"ui.userfront.login.verification.title_pending": "로그인 승인 확인 중",
|
||||||
"ui.userfront.login.verification.title_remote": "로그인 승인 완료",
|
"ui.userfront.login.verification.title_remote": "로그인 승인 완료",
|
||||||
@@ -3155,7 +3155,7 @@ const Map<String, String> enStrings = {
|
|||||||
"msg.userfront.login.verification.approved_local":
|
"msg.userfront.login.verification.approved_local":
|
||||||
"Approved. This device is already signed in, and the remote window will be signed in shortly.",
|
"Approved. This device is already signed in, and the remote window will be signed in shortly.",
|
||||||
"msg.userfront.login.verification.approved_remote":
|
"msg.userfront.login.verification.approved_remote":
|
||||||
"Your requested sign-in is complete.",
|
"Approved.\nPlease return to the screen where you requested sign-in.",
|
||||||
"msg.userfront.login.verification.pending_remote":
|
"msg.userfront.login.verification.pending_remote":
|
||||||
"Checking the sign-in approval request. Please wait.",
|
"Checking the sign-in approval request. Please wait.",
|
||||||
"msg.userfront.login.verification.success": "Sign-in approval completed.",
|
"msg.userfront.login.verification.success": "Sign-in approval completed.",
|
||||||
@@ -4701,11 +4701,10 @@ const Map<String, String> enStrings = {
|
|||||||
"ui.userfront.login.unregistered.title": "Account not found",
|
"ui.userfront.login.unregistered.title": "Account not found",
|
||||||
"ui.userfront.login.verification.action_label": "Done",
|
"ui.userfront.login.verification.action_label": "Done",
|
||||||
"ui.userfront.login.verification.action_label_close": "Close Window",
|
"ui.userfront.login.verification.action_label_close": "Close Window",
|
||||||
"ui.userfront.login.verification.action_label_remote": "Go to sign-in window",
|
"ui.userfront.login.verification.page_title": "Baron SW Portal",
|
||||||
"ui.userfront.login.verification.page_title": "Sign-in approval",
|
|
||||||
"ui.userfront.login.verification.title": "Approval complete",
|
"ui.userfront.login.verification.title": "Approval complete",
|
||||||
"ui.userfront.login.verification.title_pending": "Checking approval",
|
"ui.userfront.login.verification.title_pending": "Checking approval",
|
||||||
"ui.userfront.login.verification.title_remote": "Sign-in approved",
|
"ui.userfront.login.verification.title_remote": "Sign-in Approved",
|
||||||
"ui.userfront.login_success.later": "Do this later (go to dashboard)",
|
"ui.userfront.login_success.later": "Do this later (go to dashboard)",
|
||||||
"ui.userfront.login_success.qr": "Use QR approval",
|
"ui.userfront.login_success.qr": "Use QR approval",
|
||||||
"ui.userfront.login_success.title": "Sign-in complete",
|
"ui.userfront.login_success.title": "Sign-in complete",
|
||||||
|
|||||||
Reference in New Issue
Block a user