/register -> require username

I am using BasicAuthentication and I would like to set username to email address automatically, so that when I POST in /register

{ “Email”: "test@test.com", “Password”: “test”}

it is created in the MySql backend as Username = "test@test.com", Email = "test@test.com" and Password == “test”.

At the moment, the above POST leaves Username NULL.

If I POST

{ “Username”: "test@test.com", “Email”: "test@test.com", “Password”: “test”}

it protests that Username contains invalid characters.

So:

  1. Can an Username contain an email address?
  2. Is it possible to default Username to the EMail address?

When the Email field is populated and Username is empty, the Email is what’s used to log into the account so just leave UserName empty.