Merge branch 'soru/no-empty-ssss-passphrase' into 'main'

fix: Don't allow an empty ssss passphrase in key verification

See merge request famedly/fluffychat!326
This commit is contained in:
Krille Fear 2020-12-31 10:49:51 +00:00
commit 116c6f5669

View File

@ -67,7 +67,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
final textEditingController = TextEditingController();
String input;
final checkInput = () async {
if (input == null) {
if (input == null || input.isEmpty) {
return;
}
final valid = await showFutureLoadingDialog(
@ -77,15 +77,10 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
await Future.delayed(Duration(milliseconds: 100));
var valid = false;
try {
await widget.request.openSSSS(recoveryKey: input);
await widget.request.openSSSS(keyOrPassphrase: input);
valid = true;
} catch (_) {
try {
await widget.request.openSSSS(passphrase: input);
valid = true;
} catch (_) {
valid = false;
}
valid = false;
}
return valid;
});