Protect 2FA behind lockscreen

This commit is contained in:
Vishnu Mohandas 2021-06-29 16:48:11 +05:30
parent b5863d9dcd
commit 3465fe50e4

View file

@ -128,6 +128,12 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
return Switch(
value: snapshot.data,
onChanged: (value) async {
final result = await requestAuthentication();
if (!result) {
showToast(
"please authenticate to configure two-factor authentication");
return;
}
if (value) {
UserService.instance.setupTwoFactor(context);
} else {