2. Expected behavior - IsInCustomerRole should return true,if user is already registered
3. Actual behavior - but it return false
4. Steps to reproduce the problem - Register new user, don't logout go to url http://localhost:15536/register ,
write down correct data, and you would be registered again.
5. Any private modifications you made to your nopCommerce , i did some but it doesn't affect the original behavior/logic.
public static bool IsInCustomerRole(...)
{
var result = customer.CustomerRoles
.FirstOrDefault(cr => (!onlyActiveCustomerRoles || cr.Active) && cr.SystemName == customerRoleSystemName) != null;
}
!onlyActiveCustomerRoles and operator 'or' || is the problem , it would always return false.
I don't get for what purpose it was made but, if u even set onlyActiveCustomerRoles to false, it would complitly ignore the whole logic
customer.CustomerRoles,
.FirstOrDefault
and would return null. Why this is made ?