Page MenuHomePhabricator

D9679.diff
No OneTemporary

D9679.diff

diff --git a/services/identity/src/client_service.rs b/services/identity/src/client_service.rs
--- a/services/identity/src/client_service.rs
+++ b/services/identity/src/client_service.rs
@@ -489,7 +489,25 @@
id
}
None => {
- // User doesn't exist yet, so we should add a new user in DDB
+ // It's possible that the user attempting login is already registered
+ // on Ashoat's keyserver. If they are, we should send back a gRPC status
+ // code instructing them to get a signed message from Ashoat's keyserver
+ // in order to claim their wallet address and register with the Identity
+ // service.
+ let username_in_reserved_usernames_table = self
+ .client
+ .username_in_reserved_usernames_table(&wallet_address)
+ .await
+ .map_err(handle_db_error)?;
+
+ if username_in_reserved_usernames_table {
+ return Err(tonic::Status::failed_precondition(
+ "need keyserver message to claim username",
+ ));
+ }
+
+ // User doesn't exist yet and wallet address isn't reserved, so we
+ // should add a new user in DDB
self
.client
.add_wallet_user_to_users_table(

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 5, 9:29 PM (22 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2246512
Default Alt Text
D9679.diff (1 KB)

Event Timeline