Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Plus in email address #5503


User avatar
0
sebastian.morar created

I am trying to make email validator to accept plus sign (+) when creating an user.

Could you please help me out with this issue?


8 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    I could not reproduce that when creating an user. Were you perhaps creating a tenant or self-registration?

    PR: https://github.com/aspnetzero/aspnet-zero-core/pull/1561

  • User Avatar
    0
    sebastian.morar created

    Hi Aaron,

    Thank you for your answer.

    I am definitely creating a user. I have just tried again (the user is being created in a tenant) with no success.

    I have purchased aspnetzero less than a month ago, I have version v5.6. Where did you tried to reproduce?

    Thanks, Sebastian Morar

  • User Avatar
    0
    aaron created
    Support Team

    v5.6.2. You can refer to my PR #1561 and make similar changes.

  • User Avatar
    0
    sebastian.morar created

    Hi Aaron,

    The link you gave me return 404. When trying to go to <a class="postlink" href="https://github.com/aspnetzero">https://github.com/aspnetzero</a> I see only one repository (documents) which is not hepful.

    Do I need some rights to access the page with the PR?

    Thanks

  • User Avatar
    0
    alper created
    Support Team

    the related pull request resolves plus character in emails. here you can see the committed changes. update the corresponding files

    <ins>angular/src/account/register/register.component.html</ins>

    <div class="form-group m-form__group">
                    <input #emailAddressInput="ngModel" class="form-control" type="email" placeholder="{{l('EmailAddress')}} *" [(ngModel)]="model.emailAddress" name="EmailAddress" required maxlength="256" pattern="^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" />
                    <validation-messages [formCtrl]="emailAddressInput"></validation-messages>
    </div>
    

    <ins>angular/src/app/admin/tenants/create-tenant-modal.component.html</ins>

    <div class="form-group">
    	<label for="AdminEmailAddress">{{l("AdminEmailAddress")}} *</label>
    	<input id="AdminEmailAddress" #adminEmailAddressInput="ngModel" type="email" name="AdminEmailAddress" class="form-control" [(ngModel)]="tenant.adminEmailAddress" [ngClass]="{'edited':tenant.adminEmailAddress}" required pattern="^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" maxlength="256">
    	<validation-messages [formCtrl]="adminEmailAddressInput" [errorDefs]="[{pattern: l('InvalidEmailAddress')}]"></validation-messages>
    </div>
    

    <ins>angular/src/app/admin/users/create-or-edit-user-modal.component.html</ins>

    <div class="form-group">
    	<label for="EmailAddress">{{l("EmailAddress")}} *</label>
    	<input id="EmailAddress" #emailAddressInput="ngModel" type="email" name="EmailAddress" class="form-control" [(ngModel)]="user.emailAddress" required maxlength="256" email />
    	<validation-messages [formCtrl]="emailAddressInput" [errorDefs]="[{email: l('InvalidEmailAddress')}]"></validation-messages>
    </div>
    
  • User Avatar
    0
    sebastian.morar created

    Hi Alper, Aaron,

    I'm using MVC rather than Angular. Could you share the code for MVC?

    Thanks

  • User Avatar
    0
    aaron created
    Support Team

    Do I need some rights to access the page with the PR?

    You need to login with your GitHub account to access the private repo. You can invite yourself here: <a class="postlink" href="https://aspnetzero.com/LicenseManagement">https://aspnetzero.com/LicenseManagement</a>

    I'm using MVC rather than Angular.

    Next time, put that in your opening post. I'll check.

  • User Avatar
    0
    aaron created
    Support Team