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)
Mon, Oct 21, 3:48 AM
Unknown Object (File)
Fri, Oct 11, 11:08 PM
Unknown Object (File)
Thu, Oct 10, 9:50 PM
Unknown Object (File)
Thu, Oct 10, 12:16 PM
Unknown Object (File)
Thu, Oct 10, 12:16 PM
Unknown Object (File)
Thu, Oct 10, 12:15 PM
Unknown Object (File)
Thu, Oct 10, 11:33 AM
Unknown Object (File)
Fri, Oct 4, 8:34 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable