1
0
forked from baron/baron-sso

fix userfront verify-only approval routing

This commit is contained in:
2026-05-21 14:33:40 +09:00
parent d56c041b67
commit eb46918397
2 changed files with 49 additions and 5 deletions

View File

@@ -761,6 +761,10 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
VoidCallback? _onVerificationAction;
void _runVerificationExitAction() {
_onVerificationAction?.call();
}
Widget _buildVerificationResultView() {
return Center(
child: Padding(
@@ -794,7 +798,11 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
FilledButton(
onPressed: () {
if (_onVerificationAction != null) {
_onVerificationAction!();
_runVerificationExitAction();
return;
}
if (_verificationOnly) {
webWindow.close();
return;
}
final hasLocalSession =
@@ -1604,11 +1612,14 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
if (_verificationOnly && _verificationApproved) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text(_verificationPageTitle),
leading: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () => context.go(buildLocalizedHomePath(Uri.base)),
),
leading: _onVerificationAction == null
? null
: IconButton(
icon: const Icon(Icons.close),
onPressed: _runVerificationExitAction,
),
actions: const [ThemeToggleButton(compact: true)],
),
body: _buildVerificationResultView(),