diff --git a/.vscode/launch.json b/.vscode/launch.json index f016d94b..d298ddc0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "type": "dart-cli", "request": "launch", "cwd": "${workspaceRoot}/example", - "debugSettings": "${command.debugSettings}", + "debugSettings": "${command:debugSettings}", "program": "${workspaceRoot}/example/server.dart", "args": [] } diff --git a/example/server.dart b/example/server.dart index 77ecc341..e47b379a 100644 --- a/example/server.dart +++ b/example/server.dart @@ -11,7 +11,7 @@ const Map TWITTER_CONFIG = const { 'secret': 'n2oA0ZtR7TzYincpMYElRpyYovAQlhYizTkTm2x5QxjH6mLVyE' }; -verifier(Twit twit) async { +verifier(TwitBase twit) async { // Maybe fetch user credentials: return await twit.get('/account/verify_credentials.json'); } diff --git a/lib/angel_auth_twitter.dart b/lib/angel_auth_twitter.dart index 8bf56cb9..ef44080c 100644 --- a/lib/angel_auth_twitter.dart +++ b/lib/angel_auth_twitter.dart @@ -5,13 +5,12 @@ import 'dart:io'; import 'package:angel_auth/angel_auth.dart'; import 'package:angel_framework/angel_framework.dart'; import 'package:crypto/crypto.dart'; -import 'package:http/http.dart' as http; import 'package:random_string/random_string.dart' as rs; -import 'package:twit/twit.dart'; +import 'package:twit/io.dart'; const String _ENDPOINT = "https://api.twitter.com"; -typedef TwitterAuthVerifier(Twit twit); +typedef TwitterAuthVerifier(TwitBase twit); class TwitterStrategy extends AuthStrategy { HttpClient _client = new HttpClient(); @@ -158,7 +157,7 @@ class TwitterStrategy extends AuthStrategy { accessTokenSecret: loginData['oauth_token_secret'] ); - var twit = new Twit(credentials, new http.Client()); + var twit = new Twit(credentials); return await this.verifier(twit); } } diff --git a/pubspec.yaml b/pubspec.yaml index 3735fbf5..3b28bf23 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ environment: sdk: ">=1.19.0" homepage: "https://github.com/angel-dart/auth_twitter.git" name: "angel_auth_twitter" -version: "1.0.1" +version: "1.0.2" dependencies: angel_auth: "^1.0.0-dev" random_string: "^0.0.1"