From 36341bf0b59618ce661b9afab98df0942b889aa7 Mon Sep 17 00:00:00 2001 From: stokato Date: Tue, 11 Aug 2026 14:36:54 +0300 Subject: [PATCH 1/2] Added an optional authorization protocol version to allow the server to select the appropriate authentication flow while preserving compatibility with older clients. --- CHANGELOG.md | 4 ++++ lib/external_login_interface.dart | 12 ++++++++++-- pubspec.yaml | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d8e0f5..6dae684 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.1.9] - 2026-08-11 + +* Added an optional authorization protocol version to `ExternalLoginData` to allow the server to select the appropriate authentication flow while preserving compatibility with older clients. + ## [0.1.8] - 2026-02-11 * Added new `invalidTime` error with factory method. diff --git a/lib/external_login_interface.dart b/lib/external_login_interface.dart index 77f7fd6..d0c8f2b 100644 --- a/lib/external_login_interface.dart +++ b/lib/external_login_interface.dart @@ -14,7 +14,7 @@ abstract class ExternalLogin { /// If is't error, than [ErrorResult.error] /// should contains [ExternalLoginErrorData]. /// - /// If [loadAvatar] is `true` than implemention + /// If [loadAvatar] is `true` than implementation /// should request information about user picture. Future> login({bool loadAvatar = false}); @@ -90,6 +90,13 @@ class ExternalLoginData { /// Required by some services, e.g. Apple. final String? clientId; + /// The authorization protocol version used by the client. + /// + /// If `null`, the server must use the legacy authorization flow. + /// This allows older client versions that do not provide this value + /// to remain compatible with the server. + final int? version; + /// Additional data final Map? data; @@ -100,6 +107,7 @@ class ExternalLoginData { this.clientId, this.avatarUrl, this.email, + this.version, this.data, }); @@ -107,7 +115,7 @@ class ExternalLoginData { String toString() { return 'ExternalLoginResult{userId: $userId, token: $token, ' 'fullName: $fullName, clientId: $clientId, avatarUrl: $avatarUrl, ' - 'email: $email, data: $data}'; + 'email: $email, version: $version, data: $data}'; } } diff --git a/pubspec.yaml b/pubspec.yaml index 7378055..23fd37f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: external_login_interface description: Interface for external login feature. -version: 0.1.8 +version: 0.1.9 homepage: https://github.com/innim/ repository: https://github.com/Innim/flutter_external_login_interface issue_tracker: https://github.com/Innim/flutter_external_login_interface/issues From 0f72e7fa1d8d73e07060bbb775f7d85f660914dc Mon Sep 17 00:00:00 2001 From: stokato Date: Tue, 11 Aug 2026 15:44:07 +0300 Subject: [PATCH 2/2] Documentation fix --- lib/external_login_interface.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/external_login_interface.dart b/lib/external_login_interface.dart index d0c8f2b..8563d7f 100644 --- a/lib/external_login_interface.dart +++ b/lib/external_login_interface.dart @@ -92,9 +92,9 @@ class ExternalLoginData { /// The authorization protocol version used by the client. /// - /// If `null`, the server must use the legacy authorization flow. - /// This allows older client versions that do not provide this value - /// to remain compatible with the server. + /// A null value means that the client does not specify a protocol version. + /// This allows the server to select the appropriate authorization flow + /// based on the available information. final int? version; /// Additional data