IdentityServer
IdentityServer copied to clipboard
use static equals method to avoid exception
user.Password could be null.
Is it actually possible to create a TestUser instance without a password, or to submit the QuickStart ui's login page without entering a password? If so, maybe we should prevent that. Ultimately the TestUserStore isn't meant for production, so we should just make the developer experience as good as possible.
The previous line checks explicit the possible null value for user password.
if (string.IsNullOrWhiteSpace(user.Password)
Right. The type is for testing purpose only.
Nevertheless we could use Object.Equals or String.Equals methods to make a safer comparision and avoid a possible System.NullReferenceException.
Okay, I had some thought of possibly looking at nullability annotations to make this impossible, but on second thought I'm just going to go ahead and merge it and not worry about the annotations. Thanks @testfirstcoder!