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 > {
@@ -137,9 +138,12 @@ class _EmailPasswordLoginPageState extends State<EmailPasswordLoginPage> {
137
138
try {
138
139
result = await fetchApiKey (
139
140
realmUrl: realmUrl, username: email, password: password);
140
- } on Exception catch (e) { // TODO(#37): distinguish API exceptions
141
- // TODO(#35): give feedback to user on failed login
142
- debugPrint (e.toString ());
141
+ } on Exception { // TODO(#37): distinguish API exceptions
142
+ if (! context.mounted) return ;
143
+ // TODO(#35) give more helpful feedback. Needs #37. The RN app is
144
+ // unhelpful here; we should at least recognize invalid auth errors, and
145
+ // errors for deactivated user or realm (see zulip-mobile#4571).
146
+ showErrorDialog (context: context, title: 'Login failed' );
143
147
return ;
144
148
}
145
149
You can’t perform that action at this time.
0 commit comments