mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 17:11:14 +00:00
Merge pull request 'fix(dns): Make sure that we notice domain ownership lost' (#441) from dns-check into master
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/pulls/441 Reviewed-by: Inex Code <inex.code@selfprivacy.org>
This commit is contained in:
commit
76c420301c
|
@ -162,7 +162,8 @@
|
|||
"services_subtitle": "Type “A” records required for each service.",
|
||||
"email_title": "Email",
|
||||
"email_subtitle": "Records necessary for secure email exchange.",
|
||||
"update_list": "Update list"
|
||||
"update_list": "Update list",
|
||||
"domain_validation_failure": "We can't reach your domain!"
|
||||
},
|
||||
"backup": {
|
||||
"card_title": "Backup",
|
||||
|
@ -633,4 +634,4 @@
|
|||
"reset_onboarding_description": "Reset onboarding switch to show onboarding screen again",
|
||||
"cubit_statuses": "Cubit loading statuses"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,6 @@
|
|||
import 'package:cubit_form/cubit_form.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:selfprivacy/config/get_it_config.dart';
|
||||
import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/desired_dns_record.dart';
|
||||
import 'package:selfprivacy/logic/cubit/app_config_dependent/authentication_dependend_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/hive/server_domain.dart';
|
||||
|
@ -45,10 +47,11 @@ class DnsRecordsCubit
|
|||
domain,
|
||||
extractDkimRecord(allDnsRecords)?.content ?? '',
|
||||
allDnsRecords,
|
||||
ipAddress,
|
||||
);
|
||||
|
||||
if (!foundRecords.success || foundRecords.data.isEmpty) {
|
||||
emit(const DnsRecordsState());
|
||||
emit(const DnsRecordsState(dnsState: DnsRecordsStatus.error));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -72,7 +75,19 @@ class DnsRecordsCubit
|
|||
final ServerDomain domain,
|
||||
final String dkimPublicKey,
|
||||
final List<DnsRecord> pendingDnsRecords,
|
||||
final String ip4,
|
||||
) async {
|
||||
final matchMap = await validateDnsMatch(domain.domainName, ['api'], ip4);
|
||||
if (matchMap.values.any((final status) => status != DnsRecordStatus.ok)) {
|
||||
getIt<NavigationService>().showSnackBar(
|
||||
'domain.domain_validation_failure'.tr(),
|
||||
);
|
||||
return GenericResult(
|
||||
success: false,
|
||||
data: [],
|
||||
);
|
||||
}
|
||||
|
||||
final result = await ProvidersController.currentDnsProvider!
|
||||
.getDnsRecords(domain: domain);
|
||||
if (result.data.isEmpty || !result.success) {
|
||||
|
|
Loading…
Reference in a new issue