fix login error
This commit is contained in:
parent
ac8fc71b3b
commit
5831db260f
@ -444,10 +444,8 @@ Future<bool?> loginDialog() async {
|
||||
}
|
||||
} on RequestException catch (err) {
|
||||
passwordMsg = translate(err.cause);
|
||||
debugPrintStack(label: err.toString());
|
||||
} catch (err) {
|
||||
passwordMsg = "Unknown Error: $err";
|
||||
debugPrintStack(label: err.toString());
|
||||
}
|
||||
curOP.value = '';
|
||||
setState(() => isInProgress = false);
|
||||
@ -582,10 +580,8 @@ Future<bool?> verificationCodeDialog(UserPayload? user) async {
|
||||
}
|
||||
} on RequestException catch (err) {
|
||||
errorText = translate(err.cause);
|
||||
debugPrintStack(label: err.toString());
|
||||
} catch (err) {
|
||||
errorText = "Unknown Error: $err";
|
||||
debugPrintStack(label: err.toString());
|
||||
}
|
||||
|
||||
setState(() => isInProgress = false);
|
||||
|
@ -64,7 +64,7 @@ class UserModel {
|
||||
try {
|
||||
return json.decode(userInfo);
|
||||
} catch (e) {
|
||||
debugPrint('Failed to get local user info, json decode "$userInfo": $e');
|
||||
debugPrint('Failed to get local user info "$userInfo": $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -133,6 +133,9 @@ class UserModel {
|
||||
if (resp.statusCode != 200) {
|
||||
throw RequestException(resp.statusCode, body['error'] ?? '');
|
||||
}
|
||||
if (body['error'] != null) {
|
||||
throw RequestException(0, body['error']);
|
||||
}
|
||||
|
||||
return getLoginResponseFromAuthBody(body);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user