dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

Not able to register EPerson account for email address with TLD of more than 4 characters

Open bram-atmire opened this issue 2 years ago • 2 comments

Describe the bug Most TLDs are usually very short (.com, .edu, ...) But there are realy TLDs and real usecases where the TLD is longer. The largest one is currently 24 characters long cfr https://stackoverflow.com/a/22038535/3101995

To Reproduce

  1. Try to register an eperson for an email address where the last part after the period, the TLD, is longer than 4 characters

Observed behavior Angular blocks creation of this account

Expected behavior I should be able to register an account

The fix Change 4 to 24 at the very end of the pattern here: https://github.com/DSpace/dspace-angular/blob/main/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts#L255

Workaround If you are confronted with this problem and urgently need EPeople created with TLD email addresses + 4 characters, know that this validation is NOT applied when you create EPeople through the REST command line using:

[dspace]/bin/dspace create-administrator

Obviously, this command creates an administrator account. If you don't want the account to be an administrator, make sure you subsequently remove the person from the admin group in the user interface!!!

Related work Link to any related tickets or PRs here.

bram-atmire avatar Oct 27 '23 11:10 bram-atmire

There are two other places where the email validation could be changed to accommodate 24 characters:

  • https://github.com/DSpace/dspace-angular/blob/main/src/app/info/feedback/feedback-form/feedback-form.component.ts#L32
  • https://github.com/DSpace/dspace-angular/blob/main/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts#L67

But then I noticed that the new user registration page uses a completely different regex for email validation:

  • https://github.com/DSpace/dspace-angular/blob/main/src/app/register-email-form/register-email-form.component.ts#L102

Which one is preferred?

nwoodward avatar Nov 02 '23 22:11 nwoodward

Fixed by #2958

tdonohue avatar Apr 19 '24 14:04 tdonohue