diff --git a/mobile/packages/accounts/lib/services/user_service.dart b/mobile/packages/accounts/lib/services/user_service.dart index ce636beae8..e6246fd1a9 100644 --- a/mobile/packages/accounts/lib/services/user_service.dart +++ b/mobile/packages/accounts/lib/services/user_service.dart @@ -160,6 +160,24 @@ class UserService { ); } + // getPublicKey returns null value if email id is not + // associated with another ente account + Future getPublicKey(String email) async { + try { + final response = await _enteDio.get( + "/users/public-key", + queryParameters: {"email": email}, + ); + final publicKey = response.data["publicKey"]; + return publicKey; + } on DioException catch (e) { + if (e.response != null && e.response?.statusCode == 404) { + return null; + } + rethrow; + } + } + Future getUserDetailsV2({ bool memoryCount = false, bool shouldCache = true,