From ca3f0b71dd5aed8fabad16981493d05eeec8fa67 Mon Sep 17 00:00:00 2001 From: Roscoe Rubin-Rottenberg Date: Fri, 27 Mar 2026 17:05:47 -0700 Subject: [PATCH] fix(auth): oauth client patch overrides waiting for atproto.dart PR #2277 --- lib/src/core/auth/data/models/account.dart | 6 ++++++ .../repositories/auth_repository_impl.dart | 2 ++ pubspec.lock | 20 ++++++++++--------- pubspec.yaml | 13 ++++++++++++ 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/lib/src/core/auth/data/models/account.dart b/lib/src/core/auth/data/models/account.dart index 6918133c..83b58da9 100644 --- a/lib/src/core/auth/data/models/account.dart +++ b/lib/src/core/auth/data/models/account.dart @@ -7,6 +7,7 @@ class Account { required this.refreshToken, required this.publicKey, required this.privateKey, + this.clientId, this.dpopNonce, this.expiresAt, this.did, @@ -21,6 +22,7 @@ class Account { refreshToken: json['refreshToken'] as String, publicKey: json['publicKey'] as String, privateKey: json['privateKey'] as String, + clientId: json['clientId'] as String?, dpopNonce: json['dpopNonce'] as String?, expiresAt: json['expiresAt'] as String?, did: json['did'] as String?, @@ -38,6 +40,7 @@ class Account { final String refreshToken; final String publicKey; final String privateKey; + final String? clientId; final String? dpopNonce; final String? expiresAt; final String? did; @@ -51,6 +54,7 @@ class Account { 'refreshToken': refreshToken, 'publicKey': publicKey, 'privateKey': privateKey, + 'clientId': clientId, 'dpopNonce': dpopNonce, 'expiresAt': expiresAt, 'did': did, @@ -67,6 +71,7 @@ class Account { String? refreshToken, String? publicKey, String? privateKey, + String? clientId, String? dpopNonce, String? expiresAt, String? did, @@ -79,6 +84,7 @@ class Account { refreshToken: refreshToken ?? this.refreshToken, publicKey: publicKey ?? this.publicKey, privateKey: privateKey ?? this.privateKey, + clientId: clientId ?? this.clientId, dpopNonce: dpopNonce ?? this.dpopNonce, expiresAt: expiresAt ?? this.expiresAt, did: did ?? this.did, diff --git a/lib/src/core/auth/data/repositories/auth_repository_impl.dart b/lib/src/core/auth/data/repositories/auth_repository_impl.dart index 82a50bf9..073f3a33 100644 --- a/lib/src/core/auth/data/repositories/auth_repository_impl.dart +++ b/lib/src/core/auth/data/repositories/auth_repository_impl.dart @@ -132,6 +132,7 @@ class AuthRepositoryImpl implements AuthRepository { _oauthSession = restoreOAuthSession( accessToken: account.accessToken, refreshToken: account.refreshToken, + clientId: account.clientId ?? _clientMetadataUrl, dPoPNonce: account.dpopNonce, publicKey: account.publicKey, privateKey: account.privateKey, @@ -191,6 +192,7 @@ class AuthRepositoryImpl implements AuthRepository { refreshToken: _oauthSession!.refreshToken, publicKey: _oauthSession!.$publicKey, privateKey: _oauthSession!.$privateKey, + clientId: _oauthSession!.$clientId ?? _clientMetadataUrl, dpopNonce: _oauthSession!.$dPoPNonce, expiresAt: _oauthSession!.expiresAt.toIso8601String(), did: _did, diff --git a/pubspec.lock b/pubspec.lock index 4cc20014..b0a7ca5d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -108,18 +108,20 @@ packages: atproto_core: dependency: "direct main" description: - name: atproto_core - sha256: "76b8c6237cf0c446c2f056cd76723eb5d7993ecaf7f7cc417b1b6bf26d8f24ce" - url: "https://pub.dev" - source: hosted + path: "packages/atproto_core" + ref: oauth-client-id + resolved-ref: ae0e15b559ef6dec220ee87eedeaa29618fc543f + url: "https://github.com/knotbin/atproto.dart.git" + source: git version: "1.2.0" atproto_oauth: - dependency: transitive + dependency: "direct overridden" description: - name: atproto_oauth - sha256: "42a3a98dae11eb8c2a8a83051ebda9d0a711aec998c280c4f94a1a7127ba0aed" - url: "https://pub.dev" - source: hosted + path: "packages/atproto_oauth" + ref: oauth-client-id + resolved-ref: ae0e15b559ef6dec220ee87eedeaa29618fc543f + url: "https://github.com/knotbin/atproto.dart.git" + source: git version: "0.2.0" audio_waveforms: dependency: "direct main" diff --git a/pubspec.yaml b/pubspec.yaml index ac474088..7df27964 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -80,6 +80,19 @@ dev_dependencies: json_serializable: ^6.11.2 riverpod_generator: ^4.0.3 +# Temporary overrides, waiting for https://github.com/myConsciousness/atproto.dart/pull/2277 to be merged +dependency_overrides: + atproto_core: + git: + url: https://github.com/knotbin/atproto.dart.git + path: packages/atproto_core + ref: oauth-client-id + atproto_oauth: + git: + url: https://github.com/knotbin/atproto.dart.git + path: packages/atproto_oauth + ref: oauth-client-id + flutter_launcher_icons: android: true ios: true -- 2.54.0