Kode-Rex / HangfireBasicAuthenticationFilter

A basic auth filter for hangfire dashboard
GNU General Public License v3.0
27 stars 12 forks source link

[PR] Fixed invalid tokens check #6

Open svensteudter opened 2 years ago

svensteudter commented 2 years ago

Check for invalid tokens: Current: checks: Are_Invalid() { token.length == 2 && token[0].IsNullOrWhiteSpace && token[1].IsNullOrWhiteSpace } so all three conditions must be true => token is invalid. Expected: But token length == 2 is valid and a only one token[] being null or emptyshould result in invalid

Approach: renamed all three checks to "Invalid_..." checking for being invalid (i.e. token.length != 2)

and check all three conditionns with OR, ONE condition NOT met => invalid token.