Skip to content

Commit 5c0058a

Browse files
Ivan KamkinIvan Kamkin
authored andcommitted
Snippets fixed to run with token in env var
1 parent 2e18697 commit 5c0058a

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

snippets/read/set_source/recognize_get.dart

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import 'dart:io';
2+
13
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
24

35
Configuration makeConfiguration() {
4-
return Configuration(
5-
clientId: "Client Id from https://dashboard.aspose.cloud/applications",
6-
clientSecret:
7-
"Client Secret from https://dashboard.aspose.cloud/applications",
8-
);
6+
final jwtToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
7+
if (jwtToken != null) {
8+
return Configuration(accessToken: jwtToken);
9+
} else {
10+
return Configuration(
11+
clientId: "Client Id from https://dashboard.aspose.cloud/applications",
12+
clientSecret:
13+
"Client Secret from https://dashboard.aspose.cloud/applications",
14+
);
15+
}
916
}
1017

1118
Future<void> main() async {

0 commit comments

Comments
 (0)