Add getPublicKey method to UserService for retrieving public keys by email

This commit is contained in:
AmanRajSinghMourya
2025-08-27 13:49:01 +05:30
parent adef8bd466
commit 326eb3ff8a

View File

@@ -160,6 +160,24 @@ class UserService {
);
}
// getPublicKey returns null value if email id is not
// associated with another ente account
Future<String?> 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<UserDetails> getUserDetailsV2({
bool memoryCount = false,
bool shouldCache = true,