Implements Shans notes on changins security stamp for chaning email/username

This commit is contained in:
Warren Buckley
2020-02-11 11:52:44 +00:00
parent 6ae88f6c76
commit a7ff82f29a

View File

@@ -557,6 +557,16 @@ ORDER BY colName";
}
}
// If userlogin or the email has changed then need to reset security stamp
if (changedCols.Contains("userLogin") || changedCols.Contains("userEmail"))
{
userDto.EmailConfirmedDate = null;
userDto.SecurityStampToken = entity.SecurityStamp = Guid.NewGuid().ToString();
changedCols.Add("emailConfirmedDate");
changedCols.Add("securityStampToken");
}
//only update the changed cols
if (changedCols.Count > 0)
{