Page MenuHomePhabricator

[keyserver][native] treat valid eth address as invalid username in non-siwe registration
ClosedPublic

Authored by varun on Feb 29 2024, 1:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 9:49 AM
Unknown Object (File)
Wed, Nov 13, 7:57 PM
Unknown Object (File)
Wed, Nov 13, 1:43 PM
Unknown Object (File)
Wed, Nov 13, 12:49 PM
Unknown Object (File)
Tue, Nov 12, 4:53 PM
Unknown Object (File)
Mon, Nov 4, 5:34 AM
Unknown Object (File)
Mon, Oct 21, 3:48 AM
Unknown Object (File)
Oct 11 2024, 11:08 PM
Subscribers

Details

Summary

on native, we currently check if the username chosen by a user satisfies the validUsernameRegex check, but we don't check if it is a valid eth address. when the user tries to register with a valid eth address as their username in non-siwe registration, the keyserver sends back a reserved username error. this is confusing, because it's actually an invalid username, not a reserved one. in this diff i've added the isValidEthereumAddress check to the UsernameSelection component on native and i've updated createAccount on keyserver to return an invalid username error instead of a reserved username error in this scenario.

Test Plan
  1. set validUsername to true on native and confirmed that the keyserver returns an invalid username error
  2. with the updated validUsername check on native, the "next" button is now grayed out if the user tries to pick a valid eth address as their username

Diff Detail

Repository
rCOMM Comm
Branch
invalidUsername (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage