Page 1 of 1

Invalid email address issue

Posted: 08 Aug 2023, 20:42
by moccha
I'm using the SignUpAssistant for users to create accounts. Due to changes over the years, emails that were once invalid are now valid. Web standards are now supporting ASCII.

See this post for information: https://stackoverflow.com/a/2071250

I tried making a test account with the user email of mason@日本.com, but I see that Smartfox itself is rejecting "bad" emails:

Code: Select all

WARN  [SFSWorker:Ext:3] signup.SignUpAssistant  - Email address: mason@日本.com  is invalid, from ( User Name: Guest#1, Id: 1, Priv: 0, Sess: 127.0.0.1:52764 )
I do not validate the email at all currently in my own code, so it must be in the assistant settings. I think the only rules for email could that it needs to be in the format a@b.com - Regex for that would look like:

Code: Select all

~/^.+@.+\..+$/g
For now I have done:

Code: Select all

suac.getConfig().isEmailRequired = false;
and then pass email as an extra field to validate myself.

Re: Invalid email address issue

Posted: 09 Aug 2023, 07:21
by Lapo
Thanks for the heads-up.
We'll update the component to reflect the new naming standards. It would probably be best to allow the email validation to be customized, so that developers can use different rules based on their audience and needs.

Cheers