Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
AStA
Digitaler 3G-Nachweis
Commits
ab54357e
Commit
ab54357e
authored
Dec 08, 2021
by
Leon Tappe
🔥
Browse files
add proper check for valid qr code to prevent 500s
parent
d02a76b2
Changes
4
Hide whitespace changes
Inline
Side-by-side
verification/ios/Podfile.lock
View file @
ab54357e
...
...
@@ -14,7 +14,7 @@ PODS:
- Reachability (3.2)
- shared_preferences_ios (0.0.1):
- Flutter
- url_launcher (0.0.1):
- url_launcher
_ios
(0.0.1):
- Flutter
DEPENDENCIES:
...
...
@@ -24,7 +24,7 @@ DEPENDENCIES:
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- url_launcher
_ios
(from `.symlinks/plugins/url_launcher
_ios
/ios`)
SPEC REPOS:
trunk:
...
...
@@ -44,8 +44,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/qr_code_scanner/ios"
shared_preferences_ios:
:path: ".symlinks/plugins/shared_preferences_ios/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
url_launcher
_ios
:
:path: ".symlinks/plugins/url_launcher
_ios
/ios"
SPEC CHECKSUMS:
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
...
...
@@ -56,8 +56,8 @@ SPEC CHECKSUMS:
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
shared_preferences_ios: aef470a42dc4675a1cdd50e3158b42e3d1232b32
url_launcher
: b6e016d912f04be9f5bf6e8e82dc599b7ba59649
url_launcher
_ios: 02f1989d4e14e998335b02b67a7590fa34f971af
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
COCOAPODS: 1.1
0.0
COCOAPODS: 1.1
1.2
verification/lib/home_page.dart
View file @
ab54357e
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:io'
;
import
'dart:typed_data'
;
import
'package:connectivity/connectivity.dart'
;
import
'package:digital_3g_common/backend_switcher.dart'
;
...
...
@@ -468,6 +470,13 @@ class _HomePageState extends State<HomePage> {
controller
.
scannedDataStream
.
listen
((
scanData
)
{
if
((
scanData
.
code
?.
isNotEmpty
??
false
)
&&
!
_disconnected
)
{
if
(
_lastResult
!=
scanData
.
code
)
{
// check for valid base64 or else cancel
try
{
final
Uint8List
decoded
=
base64
.
decode
(
scanData
.
code
!);
if
(
decoded
.
isEmpty
)
return
;
}
catch
(
e
)
{
return
;
}
_qrResult
=
scanData
;
_lastResult
=
_qrResult
!.
code
!;
_bloc
!.
onAdd
(
_lastResult
);
...
...
verification/lib/verification_bloc.dart
View file @
ab54357e
...
...
@@ -52,9 +52,10 @@ class VerificationBloc extends Bloc<VerificationEvent, VerificationState> {
_verification
=
response
;
await
_verificationStore
!.
writeAsString
(
json
.
encode
(
_verification
!.
toMap
));
yield
VerificationState
.
verified
;
}
else
if
((((
await
Connectivity
().
checkConnectivity
())
==
ConnectivityResult
.
none
)
&&
(
_verificationStore
?.
existsSync
()
??
false
))
||
((
response
?.
hasError
??
false
)
&&
response
!.
error
==
VerificationErrorType
.
server
))
{
}
else
if
(((((
await
Connectivity
().
checkConnectivity
())
==
ConnectivityResult
.
none
)
||
((
response
?.
hasError
??
false
)
&&
response
!.
error
==
VerificationErrorType
.
server
))
&&
(
_verificationStore
?.
existsSync
()
??
false
)))
{
// get verification from local storage
final
loaded
=
VerificationResponse
.
fromMap
(
json
.
decode
(
await
_verificationStore
!.
readAsString
()));
...
...
verification/pubspec.lock
View file @
ab54357e
...
...
@@ -213,7 +213,7 @@ packages:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.
8
"
version: "2.0.
9
"
path_provider_ios:
dependency: transitive
description:
...
...
@@ -234,7 +234,7 @@ packages:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.
3
"
version: "2.0.
4
"
path_provider_platform_interface:
dependency: transitive
description:
...
...
@@ -255,7 +255,7 @@ packages:
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "3.
0.2
"
version: "3.
1.0
"
plugin_platform_interface:
dependency: transitive
description:
...
...
@@ -297,7 +297,7 @@ packages:
name: shared_preferences_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.
8
"
version: "2.0.
9
"
shared_preferences_ios:
dependency: transitive
description:
...
...
@@ -379,7 +379,21 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.15"
version: "6.0.17"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.13"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.13"
url_launcher_linux:
dependency: transitive
description:
...
...
@@ -407,7 +421,7 @@ packages:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.
4
"
version: "2.0.
5
"
url_launcher_windows:
dependency: transitive
description:
...
...
@@ -428,7 +442,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.
0
"
version: "2.3.
1
"
xdg_directories:
dependency: transitive
description:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment