Skip to content

Commit

Permalink
fix: save auth code.
Browse files Browse the repository at this point in the history
  • Loading branch information
stonega committed Jun 14, 2022
1 parent b4fbdab commit a7bf896
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/api/jenkins_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class JenkinsApi {
}

static Future<List<JobGroup>> getAllJobs() async {

final res = await ApiService.get('/api/json');
List<JobGroup> jobGroups = [];
if (res['jobs'] != null) {
Expand Down Expand Up @@ -136,7 +135,9 @@ class JenkinsApi {
data: data);
if (result.data != null) {
final token = result.data['data']['tokenValue'];
ApiService.setToken(base64Encode('$username:$token'.codeUnits));
final authCode = base64Encode('$username:$token'.codeUnits);
HiveBox.saveToken(authCode);
ApiService.setToken(authCode);
} else {
throw Error();
}
Expand Down

0 comments on commit a7bf896

Please sign in to comment.