Add extended function to test for registered second factor
Summary
Currently, in order to test if a user has a registered second factor, you need to do something like this:
$_2fDevices =~ /"type":\s*"TOTP"/s
Design proposition
My proposition:
# Test if the user has ANY second factor
has2f()
# Test if the user has a specific type of second factor (case insensitive)
has2f("totp")