Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit cf77598

Browse files
authored
fix invalid http error code handling (#15)
* fix invalid http error code handling
1 parent 25c13ae commit cf77598

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

lib/components/oauthHandler.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import 'package:client/appConstants.dart';
2-
import 'package:client/appLocalizations.dart';
3-
import 'package:client/components/toastNotification.dart';
42
import 'package:flutter/foundation.dart';
53
import 'package:flutter/gestures.dart';
64
import 'package:flutter/material.dart';
@@ -69,13 +67,14 @@ class _OAuthHandlerState extends State<OAuthHandler> {
6967
});
7068

7169
},
72-
onLoadError: (InAppWebViewController controller, String url, int code, String message) async {
70+
onLoadError: (InAppWebViewController controller, String url, int code, String message) {
71+
if (code == 102) { // apple signin returns 102 what is not an error
72+
return;
73+
}
7374
errorOccured();
74-
return;
7575
},
76-
onLoadHttpError: (InAppWebViewController controller, String url, int statusCode, String description) async {
76+
onLoadHttpError: (InAppWebViewController controller, String url, int statusCode, String description) {
7777
errorOccured();
78-
return;
7978
},
8079
onLoadStop: (InAppWebViewController controller, String url) async {
8180
// in case redirect url is requested, expected content will be already present

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: client
22
description: The plgd.dev mobile client for onboarding of OCF enabled devices.
3-
version: 1.0.1+1
3+
version: 1.0.1+6
44

55
environment:
66
sdk: ">=2.10.2 <3.0.0"

0 commit comments

Comments
 (0)