Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-jmattson committed May 9, 2024
1 parent f8c5238 commit 462d8be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Identity.Accounts/Models/Credentials.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 Carnegie Mellon University.
// Released under a MIT (SEI) license. See LICENSE.md in the project root.
// Copyright 2020 Carnegie Mellon University.
// Released under a MIT (SEI) license. See LICENSE.md in the project root.

using System.Linq;
using Identity.Accounts.Extensions;
Expand Down Expand Up @@ -58,7 +58,7 @@ public class UsernameRegistration
public UsernameRegistration(string value)
{
int x = value.IndexOf('<');
int y = (x > 0) ? value.IndexOf('>', x) : 0;
int y = (x >= 0) ? value.IndexOf('>', x) : 0;
Username = value.Substring(x+1, y>0 ? y-x-1 : value.Length - x - 1).Trim();
IsAffiliate = Username.ToLower().Contains(".ctr@");
DisplayName = (x > 0)
Expand Down
2 changes: 1 addition & 1 deletion src/Identity.Accounts/Services/AccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public async Task<Account> RegisterExternalUser(ClaimsPrincipal principal, strin

UpdateProperty(account, "origin", subClaim.Issuer);

if (_options.Registration.StoreEmail && email.IsEmailAddress())
if (_options.Registration.StoreEmail && registration.Username.IsEmailAddress())
{
UpdateProperty(account, ClaimTypes.Email, registration.Username);
}
Expand Down

0 comments on commit 462d8be

Please sign in to comment.