From f3f3f3e483d36d325a18b1fba0921470668141ec Mon Sep 17 00:00:00 2001 From: myConsciousness Date: Mon, 30 Jan 2023 14:02:17 +0900 Subject: [PATCH] fix: fixed for the issue (#63) --- CHANGELOG.md | 4 ++++ lib/src/response/oauth_response.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da9128e..8d9ad66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Note +## v1.0.2 + +- Fixed so that the refresh token is always set to an empty string if the `offline.access` scope is not specified. ([#63](https://github.com/twitter-dart/twitter-oauth2-pkce/issues/63)) + ## v1.0.1 - Fixed a bug where `TwitterOAuthException` did not implement `Exception`. ([#50](https://github.com/twitter-dart/twitter-oauth2-pkce/issues/50)) diff --git a/lib/src/response/oauth_response.dart b/lib/src/response/oauth_response.dart index 7cee25e..d1d4801 100644 --- a/lib/src/response/oauth_response.dart +++ b/lib/src/response/oauth_response.dart @@ -23,7 +23,7 @@ class OAuthResponse { factory OAuthResponse.fromJson(final Map json) => OAuthResponse._( accessToken: json['access_token'], - refreshToken: json['refresh_token'], + refreshToken: json['refresh_token'] ?? '', scopes: json['scope'], expires: json['expires_in'], ); diff --git a/pubspec.yaml b/pubspec.yaml index b05bbce..63f9237 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: twitter_oauth2_pkce description: Provides the optimized and easiest way to integrate OAuth 2.0 PKCE with Twitter API in Flutter. -version: 1.0.1 +version: 1.0.2 repository: https://github.com/twitter-dart/twitter-oauth2-pkce issue_tracker: "https://github.com/twitter-dart/twitter-oauth2-pkce/issues" homepage: "https://github.com/twitter-dart"