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)
Sun, Sep 15, 2:21 PM
Unknown Object (File)
Tue, Sep 10, 4:21 AM
Unknown Object (File)
Mon, Sep 9, 7:42 PM
Unknown Object (File)
Mon, Sep 9, 4:02 PM
Unknown Object (File)
Sat, Sep 7, 8:39 PM
Unknown Object (File)
Sat, Sep 7, 11:06 AM
Unknown Object (File)
Fri, Sep 6, 11:55 PM
Unknown Object (File)
Fri, Sep 6, 11:55 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