Page MenuHomePhabricator

D9679.id32651.diff
No OneTemporary

D9679.id32651.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
@@ -505,7 +505,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
Tue, Dec 3, 6:32 AM (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2610601
Default Alt Text
D9679.id32651.diff (1 KB)

Event Timeline