Koha-clms/Koha/Auth
Jonathan Druart 86fb8f1079 Bug 33904: Fix 2FA registration when library name has non-latin characters
If the library name contains non-latin characters, the 2FA registration
process will fail with a JS alert coming from a 500 server-side.

The problem is that Auth::GoogleAuth is expecting an already UTF8 encoded string.
We should set the encoding correctly to make Auth::GoogleAuth deal with
the URL escaping internally correctly, then decode on our own (in the
REST API controller)

Test plan:
* Modify your logged in library name and add some non-latin characters
(eg. "my ❤ library")
* Turn on TwoFactorAuthentication
* Go to your account > More > Manage 2FA
* Click the enable button
=> Notice that you see the QR code and that both "issuer" and "key id"
entries display the library name correctly.
* Test the whole 2FA process, confirm that the library name is correctly
displayed on the app you are using.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit deeb5ebdbd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6678645740)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 08:51:24 +00:00
..
Client Bug 31378: (follow-up) Fix QA concerns 2022-11-08 14:39:57 -03:00
Identity Bug 31378: (QA follow-up) Defer store until JSON fields are populated 2022-11-18 12:29:55 -03:00
Client.pm Bug 31378: (follow-up) Fix QA concerns 2022-11-08 14:39:57 -03:00
Permissions.pm Bug 31389: Calculate user permissions in separate function 2022-09-22 08:39:21 -03:00
TwoFactorAuth.pm Bug 33904: Fix 2FA registration when library name has non-latin characters 2023-07-12 08:51:24 +00:00