mirror of
https://github.com/Luzifer/vault-totp.git
synced 2024-12-22 22:01:19 +00:00
Fix: Some services provides lower-case base32 secrets
This commit is contained in:
parent
786b2f51f8
commit
13b379ec1a
1 changed files with 2 additions and 1 deletions
3
main.go
3
main.go
|
@ -5,6 +5,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Luzifer/rconfig"
|
"github.com/Luzifer/rconfig"
|
||||||
|
@ -122,7 +123,7 @@ func buildOutput(secret string) (string, error) {
|
||||||
// Output: "123456 (Valid 12s)", "123456 (Valid 1s)"
|
// Output: "123456 (Valid 12s)", "123456 (Valid 1s)"
|
||||||
|
|
||||||
n := time.Now()
|
n := time.Now()
|
||||||
code, err := totp.GenerateCode(secret, n)
|
code, err := totp.GenerateCode(strings.ToUpper(secret), n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue