U2F-or-TOTP 2nd Factor Authentication

This module enables both U2F and TOTP Authentication (like Gitlab). Therefore, users can use their TOTP instead if they don't have their U2F device.

Difference between enabled both U2F and TOTP is that only one page is displayed instead of displaying first a choice menu.

Configuration

In the manager (second factors), you just have to enable it:

Every other parameters of U2F and TOTP can be set in the corresponding 2F modules except that you should not enable them.
If you want to give a different level for U2F or TOTP, leave this parameter blank and set U2F and TOTP "authentication level" in corresponding modules.

Self-registration

This module has no self-registration. You have to use U2F and TOTP self registration modules. Example: suppose you want to allow U2F registration only if a TOTP secret is registered:

Automatically, U2F registration will be hidden for unregistered TOTP users and displayed then.