refactor validate_code check in preparation for sliding time windows
refactor validate_code check in preparation for sliding time windows

robertwahler/two_factor_authentication_example,robertwahler/two_factor_authentication_example