DarkGhostHunter/Laraguard

RangeException Base32::doDecode() only expects characters in the correct base32 alphabet

Closed this issue · 5 comments

I have started to get the error:

RangeException
Base32::doDecode() only expects characters in the correct base32 alphabet

after entering the 2FA code and clicking the confirm code button.

Has been working fine, so no idea why its suddenly stopped working

How I can reproduce this?

It's the introduction of the Base32 encoded storage that made the service break. You have to delete the 2FA records and recreate the secrets to be able to use the 2FA again.

Best thing would be to store the secrets in Base32 if they aren't in that format.

If I find the bug, I will re-open this again.

In a new installation it works, but if you have codes from before the change the service breaks.

In the old version the shared_secret was something like: "�Py�ˑN䀀", where it now expects: "DFIHSEGLSFHKJ"

For my installation, where there was only 1 account using 2fa it wasn't a real issue, but if you have a lot of accounts it could me more annoying.

At least for others who might encounter this issue, they now know what's the cause.

That was because version 3.0 changed the column table definition from binary to string, thus breaking change. It was something I didn't document, but was evident from the migration.

I'll have more care when dealing with migrations between versions, like the upcoming 4.0 this Thursday.