mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 17:11:14 +00:00
fix(dns): Make sure that we notice domain ownership lost
- https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/issues/390
This commit is contained in:
parent
f10441dca1
commit
2b30136def
|
@ -162,7 +162,8 @@
|
||||||
"services_subtitle": "Type “A” records required for each service.",
|
"services_subtitle": "Type “A” records required for each service.",
|
||||||
"email_title": "Email",
|
"email_title": "Email",
|
||||||
"email_subtitle": "Records necessary for secure email exchange.",
|
"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": {
|
"backup": {
|
||||||
"card_title": "Backup",
|
"card_title": "Backup",
|
||||||
|
@ -633,4 +634,4 @@
|
||||||
"reset_onboarding_description": "Reset onboarding switch to show onboarding screen again",
|
"reset_onboarding_description": "Reset onboarding switch to show onboarding screen again",
|
||||||
"cubit_statuses": "Cubit loading statuses"
|
"cubit_statuses": "Cubit loading statuses"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,6 @@
|
||||||
import 'package:cubit_form/cubit_form.dart';
|
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/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/cubit/app_config_dependent/authentication_dependend_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/models/hive/server_domain.dart';
|
import 'package:selfprivacy/logic/models/hive/server_domain.dart';
|
||||||
|
@ -45,10 +47,11 @@ class DnsRecordsCubit
|
||||||
domain,
|
domain,
|
||||||
extractDkimRecord(allDnsRecords)?.content ?? '',
|
extractDkimRecord(allDnsRecords)?.content ?? '',
|
||||||
allDnsRecords,
|
allDnsRecords,
|
||||||
|
ipAddress,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!foundRecords.success || foundRecords.data.isEmpty) {
|
if (!foundRecords.success || foundRecords.data.isEmpty) {
|
||||||
emit(const DnsRecordsState());
|
emit(const DnsRecordsState(dnsState: DnsRecordsStatus.error));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +75,19 @@ class DnsRecordsCubit
|
||||||
final ServerDomain domain,
|
final ServerDomain domain,
|
||||||
final String dkimPublicKey,
|
final String dkimPublicKey,
|
||||||
final List<DnsRecord> pendingDnsRecords,
|
final List<DnsRecord> pendingDnsRecords,
|
||||||
|
final String ip4,
|
||||||
) async {
|
) 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!
|
final result = await ProvidersController.currentDnsProvider!
|
||||||
.getDnsRecords(domain: domain);
|
.getDnsRecords(domain: domain);
|
||||||
if (result.data.isEmpty || !result.success) {
|
if (result.data.isEmpty || !result.success) {
|
||||||
|
|
Loading…
Reference in a new issue