diff options
| author | Piotr Pawlow <pp@siedziba.pl> | 2017-03-19 20:25:40 +0100 |
|---|---|---|
| committer | Piotr Pawlow <pp@siedziba.pl> | 2017-03-19 20:25:40 +0100 |
| commit | a120fa86554674a5d2e564568ccfe99046e9995b (patch) | |
| tree | 8544c8e192f3a5681d78a89678686b5fbc01790b /auth.php | |
| parent | 9f91ec73d50bc1b9c0b5a9e7bad0dd84a184a5fc (diff) | |
Allow spaces in secret.
Diffstat (limited to 'auth.php')
| -rw-r--r-- | auth.php | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -28,6 +28,7 @@ $config_default = load_config(__DIR__.'/config_default.json'); foreach($config_default as $k => $v) if (!isset($config->{$k})) $config->{$k} = $v; foreach($options as $k => $v) if ($k !== 'c') $config->{$k} = $v; +$config->secret = strtr($config->secret, [' ' => '']); if (!preg_match('/^[A-Z2-7]+$/i', $config->secret)) die("Base32 encoded secret required\n"); $totp = new TOTP(null, $config->secret, $config->period, $config->digest, $config->digits); while(true) { |
