2FA secret now seeds random to dupes
This commit is contained in:
parent
5ae7ab9317
commit
7b11eda3b4
|
@ -6,6 +6,7 @@ import (
|
|||
"math/rand"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// ParseTFACodes takes an arbitrary string and checks whether it's a valid 6
|
||||
|
@ -37,6 +38,7 @@ func GenerateBase32Key() string {
|
|||
'2', '3', '4', '5', '6', '7',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
}
|
||||
rand.Seed(time.Now().Unix())
|
||||
for i := 0; i < 16; i++ {
|
||||
tfaSecretRaw[i] = availableCharacters[rand.Int31n(int32(len(availableCharacters)))]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue