File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import '../api/route/realm.dart';
6
6
import '../api/route/users.dart' ;
7
7
import '../model/store.dart' ;
8
8
import 'app.dart' ;
9
+ import 'dialog.dart' ;
9
10
import 'store.dart' ;
10
11
11
12
class _LoginSequenceRoute extends MaterialPageRoute <void > {
@@ -136,9 +137,12 @@ class _EmailPasswordLoginPageState extends State<EmailPasswordLoginPage> {
136
137
try {
137
138
result = await fetchApiKey (
138
139
realmUrl: realmUrl, username: email, password: password);
139
- } on Exception catch (e) { // TODO(#37): distinguish API exceptions
140
- // TODO(#35): give feedback to user on failed login
141
- debugPrint (e.toString ());
140
+ } on Exception { // TODO(#37): distinguish API exceptions
141
+ if (! context.mounted) return ;
142
+ // TODO(#35) give more helpful feedback. Needs #37. The RN app is
143
+ // unhelpful here; we should at least recognize invalid auth errors, and
144
+ // errors for deactivated user or realm (see zulip-mobile#4571).
145
+ showErrorDialog (context: context, title: 'Login failed' );
142
146
return ;
143
147
} finally {
144
148
setState (() {
You can’t perform that action at this time.
0 commit comments