Skip to content

Commit aa13e42

Browse files
committed
Remove HttpStatus code object because of platform support
1 parent ced40cb commit aa13e42

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.4
2+
3+
- Removed import for HttpStatus because platform support
4+
15
## 0.0.3
26

37
- Changed import for HttpStatus

lib/oauth_chopper.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export 'package:oauth2/src/expiration_exception.dart';
88

99
export 'src/oauth_chopper.dart';
1010
export 'src/oauth_grant.dart';
11-
export 'src/storage/oauth_storage.dart';
11+
export 'src/storage/oauth_storage.dart';

lib/src/oauth_authenticator.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'dart:async';
2-
import 'dart:html';
32

43
import 'package:chopper/chopper.dart';
54
import 'package:oauth_chopper/oauth_chopper.dart';
@@ -20,7 +19,7 @@ class OAuthAuthenticator extends Authenticator {
2019
FutureOr<Request?> authenticate(Request request, Response<dynamic> response,
2120
[Request? originalRequest]) async {
2221
final token = await oauthChopper.token;
23-
if (response.statusCode == HttpStatus.unauthorized && token != null) {
22+
if (response.statusCode == 401 && token != null) {
2423
try {
2524
final credentials = await oauthChopper.refresh();
2625
if (credentials != null) {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: oauth_chopper
22
description: Add and manage OAuth2 authentication for your Chopper client.
3-
version: 0.0.3
3+
version: 0.0.4
44
homepage: https://github.com/DutchCodingCompany/oauth_chopper
55

66
environment:

0 commit comments

Comments
 (0)