Skip to content

Commit

Permalink
fix: close after used
Browse files Browse the repository at this point in the history
  • Loading branch information
seunghwanly committed Dec 24, 2024
1 parent c550983 commit 9af8b90
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions example_dart/lib/queued_interceptor_crsftoken.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,15 @@ void main() async {
jsonEncode(AuthenticationServer.generate()).codeUnits,
)}',
);

if (response.statusCode == null || response.statusCode! ~/ 100 != 2) {
tokenRefreshDio.close();
return handler.reject(error);
}

final body = jsonDecode(response.data) as Map<String, Object?>;
if (!body.containsKey('access_token')) {
tokenRefreshDio.close();
return handler.reject(error);
}

Expand Down

0 comments on commit 9af8b90

Please sign in to comment.