From 3fcdee68256b78c81bcbfb0605d57a3299753a18 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 3 Aug 2026 14:44:12 -0700 Subject: [PATCH] =?UTF-8?q?Make=20the=20OAuth=20token=20response=20scope?= =?UTF-8?q?=20optional=20=E2=80=94=20the=20spec=20allows=20omitting=20it?= =?UTF-8?q?=20and=20a=20Feedly=20refresh=20response=20without=20it=20would?= =?UTF-8?q?=20fail=20decoding=20and=20permanently=20break=20sync.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Account/Feedly/FeedlyAccountDelegate+OAuth.swift | 7 +++++-- .../Account/Feedly/OAuthAuthorizationCodeGranting.swift | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate+OAuth.swift b/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate+OAuth.swift index 414d69a3d..7a729ea24 100644 --- a/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate+OAuth.swift +++ b/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate+OAuth.swift @@ -17,12 +17,15 @@ nonisolated public struct FeedlyOAuthAccessTokenResponse: Decodable, OAuthAccess /// The ID of the Feedly user. public let id: String - // Required properties of the OAuth 2.0 Authorization Framework section 4.1.4. + // Properties of the OAuth 2.0 Authorization Framework section 4.1.4. public let accessToken: String public let tokenType: String public let expiresIn: Int public let refreshToken: String? - public let scope: String + + // Optional per RFC 6749 §5.1, and Feedly’s refresh response omits it — a non-optional + // declaration made every token refresh fail decoding, permanently breaking sync. + public let scope: String? } extension FeedlyAccountDelegate: OAuthAuthorizationGranting { diff --git a/Modules/Account/Sources/Account/Feedly/OAuthAuthorizationCodeGranting.swift b/Modules/Account/Sources/Account/Feedly/OAuthAuthorizationCodeGranting.swift index 231a396e5..cfaf47ccd 100644 --- a/Modules/Account/Sources/Account/Feedly/OAuthAuthorizationCodeGranting.swift +++ b/Modules/Account/Sources/Account/Feedly/OAuthAuthorizationCodeGranting.swift @@ -136,7 +136,7 @@ public protocol OAuthAccessTokenResponse { var tokenType: String { get } var expiresIn: Int { get } var refreshToken: String? { get } - var scope: String { get } + var scope: String? { get } } /// The access and refresh tokens from a successful authorization grant.