π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fix: streamline response data handling in UserService for passkey and two-factor session IDs
AmanRajSinghMourya7a5ccbe324d2
diff --git a/mobile/packages/accounts/lib/services/user_service.dart b/mobile/packages/accounts/lib/services/user_service.dartindex b35c29bb2d..3135c0e170 100644--- a/mobile/packages/accounts/lib/services/user_service.dart+++ b/mobile/packages/accounts/lib/services/user_service.dart@@ -469,12 +469,13 @@ class UserService {await dialog.hide();if (response.statusCode == 200) {Widget page;- final String passkeySessionID = response.data["passkeySessionID"];- final String accountsUrl = response.data["accountsUrl"] ?? kAccountsUrl;- String twoFASessionID = response.data["twoFactorSessionID"];+ final responseData = response.data;+ final String passkeySessionID = responseData["passkeySessionID"] ?? "";+ final String accountsUrl = responseData["accountsUrl"] ?? kAccountsUrl;+ String twoFASessionID = responseData["twoFactorSessionID"] ?? "";if (twoFASessionID.isEmpty &&- response.data["twoFactorSessionIDV2"] != null) {- twoFASessionID = response.data["twoFactorSessionIDV2"];+ responseData["twoFactorSessionIDV2"] != null) {+ twoFASessionID = responseData["twoFactorSessionIDV2"];}if (passkeySessionID.isNotEmpty) {page = PasskeyPage(@@ -798,12 +799,13 @@ class UserService {);if (response.statusCode == 200) {Widget? page;- final String passkeySessionID = response.data["passkeySessionID"];- final String accountsUrl = response.data["accountsUrl"] ?? kAccountsUrl;- String twoFASessionID = response.data["twoFactorSessionID"];+ final responseData = response.data;+ final String passkeySessionID = responseData["passkeySessionID"] ?? "";+ final String accountsUrl = responseData["accountsUrl"] ?? kAccountsUrl;+ String twoFASessionID = responseData["twoFactorSessionID"] ?? "";if (twoFASessionID.isEmpty &&- response.data["twoFactorSessionIDV2"] != null) {- twoFASessionID = response.data["twoFactorSessionIDV2"];+ responseData["twoFactorSessionIDV2"] != null) {+ twoFASessionID = responseData["twoFactorSessionIDV2"];}_config.setVolatilePassword(userPassword);if (passkeySessionID.isNotEmpty) {