dgryski / dgoogauth

Google Authenticator for Go
426 stars 59 forks source link

illegal base32 at byte 24 #10

Open josephspurrier opened 5 years ago

josephspurrier commented 5 years ago

I received this error when decoding my 26 character secret.

You should probably update your code to decode the secret using this: https://github.com/gokyle/twofactor/issues/10#issuecomment-381966785

Jyosua commented 5 years ago

As an update to this, it should probably use what they actually went with in the long term, which was this: https://github.com/gokyle/twofactor/commit/bbc82ff8de72400ce39a13077627531d9841ad62#diff-0f837abc04c5952e49d1812a77d447ea

dugei commented 4 years ago

base32.StdEncoding.WithPadding(base32.NoPadding).EncodeToString([]byte(token)) gen QRCode without "WithPadding(base32.NoPadding)" will invalid , so add "WithPadding(base32.NoPadding)" in line 29