Developer forum

Forum » Swift » Changing password offers to save account as mrssmith

Changing password offers to save account as mrssmith

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

Using Swift, when I change my password, my browser (Chrome) offers to save the newly created password. However, it's using mrssmith@dynamicweb.com as the suggested user name coming from the hidden anti-spam field:

This is quite confusing for the user and looks dubious.

Is there a way to fix that? I was hoping to inject a bogus hidden email field with the actual user's email address but since the form is auto-generated with the hidden fields, I can't inject my field before the others. 

Thanks!

Imar


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Yikes

You can try to change EditProfile template to have this in its change password section - around line 170:

<div class="grid gap-3 p-3">
 <div class="g-col-12">
 @foreach (LoopItem error in GetLoop("FormValidationErrors"))
 {
 <div class="alert alert-danger" role="alert">
 @error.GetString("UserManagement:User.FormValidationError.Message")
 </div>
 }
 </div>
 <input type="email" class="invisible position-absolute overflow-hidden opacity-0 bottom-0 end-0" placeholder="@Translate("Email")" autocomplete="email" value="@GetString("UserManagement:User.Email")" style="width:0px;height:0px;" />
 <div class="g-col-12">
 <div class="form-floating">
 <input type="password" class="form-control @invalidOldPassword" id="UserManagement_Form_OldPassword" name="UserManagement_Form_OldPassword" placeholder="@Translate("Old password")" required>
 <label for="UserManagement_Form_OldPassword">@Translate("Current password")</label>
 <div class="invalid-feedback">@GetString("UserManagement:User.OldPassword.Input.Error")</div>
 </div>
 </div>
 <div class="g-col-12">
 <div class="form-floating">
 <input type="password" class="form-control @invalidPassword" id="UserManagement_Form_NewPassword" name="UserManagement_Form_NewPassword" autocomplete="new-password" placeholder="@Translate("Old password")" required>
 <label for="UserManagement_Form_NewPassword">@Translate("New password")</label>
 <div class="invalid-feedback">@GetString("UserManagement:User.NewPassword.Input.Error")</div>
 </div>
 </div>

 <div class="g-col-12">
 <div class="form-floating">
 <input type="password" class="form-control @invalidConfirmPassword" id="UserManagement_Form_NewPasswordConfirm" name="UserManagement_Form_NewPasswordConfirm" autocomplete="new-password" placeholder="@Translate("Old password")" required>
 <label for="UserManagement_Form_NewPasswordConfirm">@Translate("Confirm new password")</label>
 <div class="invalid-feedback">@GetString("UserManagement:User.NewPasswordConfirm.Input.Error")</div>
 </div>
 </div>

 <div class="g-col-12">
 <button type="submit" class="btn btn-primary" id="UpdatePasswordButton">@Translate("Update password")</button>
 </div>
</div>
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Same thing unfortunately. Looks like it picks up the first field that smells like an email field (_sys_to_email)

 

You must be logged in to post in the forum