forked from baron/baron-sso
fix userfront verify-only approval routing
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user