Protect 2FA behind lockscreen
This commit is contained in:
parent
b5863d9dcd
commit
3465fe50e4
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue