In Habitat, the UserProfileService class has a method for validating users, which is called on login.
public bool ValidateUser(User user)
{
if (!string.Equals(user.Domain.Name, Context.Site.Domain.Name, StringComparison.InvariantCultureIgnoreCase))
return false;
this.SetProfileIfEmpty(user);
return this.GetUserDefaultProfileId() == user.Profile.ProfileItemId;
}
What is the purpose of the last line? What does Habitat need to confirm, before considering a user valid? The only thing I can see from following the code is that we try to find an Edit Profile page, but I'm sure I'm missing something.