Show Email instead of Username in Set Password page

|
Published

Till EUM 4.1.7340.1, the Set Password page is designed to show Username in a read only field above the Set Password form in the Set Password page. If you want this page to show Email instead, the following change can be done. This will be helpful if the Username differs from the Email, and login is done using Email.

In IdentityServer/Views/Account/SetPassword.cshtml, find the existing code which shows the Username above the Set Password text form

<div class="form-group mb-3">
      <input type="email" name="Username" class="form-control" asp-for="Username" readonly="readonly">
</div>

Replace this code by the below:

<div class="form-group mb-3">
      <input type="hidden" asp-for="Username">
      <input type="email" class="form-control" asp-for="Email" readonly="readonly">
</div>

This should now show email address instead of Username in Set Password page.