Stop throwing format exceptions when password hash isn't valid
This commit is contained in:
+10
-1
@@ -47,7 +47,16 @@ namespace MileageTraker.Web.Utility
|
||||
if (password == null)
|
||||
throw new ArgumentNullException("password");
|
||||
|
||||
var hashedPasswordBytes = Convert.FromBase64String(hashedPassword);
|
||||
byte[] hashedPasswordBytes;
|
||||
|
||||
try
|
||||
{
|
||||
hashedPasswordBytes = Convert.FromBase64String(hashedPassword);
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Verify a version 0 (see comment above) password hash.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user