diff --git a/auth/lib/utils/dialog_util.dart b/auth/lib/utils/dialog_util.dart index 6c58e1f861..bab1a66f89 100644 --- a/auth/lib/utils/dialog_util.dart +++ b/auth/lib/utils/dialog_util.dart @@ -1,3 +1,4 @@ +import 'dart:io'; import 'dart:math'; import 'package:confetti/confetti.dart'; @@ -14,6 +15,7 @@ import 'package:ente_auth/ui/components/dialog_widget.dart'; import 'package:ente_auth/ui/components/models/button_result.dart'; import 'package:ente_auth/ui/components/models/button_type.dart'; import 'package:ente_auth/utils/email_util.dart'; +import 'package:ente_auth/utils/platform_util.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -140,11 +142,19 @@ Future showGenericErrorDialog({ bool isDismissible = true, required Object? error, }) async { - final errorBody = parseErrorForUI( + String errorBody = parseErrorForUI( context, context.l10n.itLooksLikeSomethingWentWrongPleaseRetryAfterSome, error: error, ); + bool isWindowCertError = false; + if (Platform.isWindows && + error != null && + error!.toString().contains("CERTIFICATE_VERIFY_FAILED")) { + isWindowCertError = true; + errorBody = + "Certificate verification failed. Please update your system certificates, & restart the app. If the issue persists, please contact support."; + } return showDialogWidget( context: context, @@ -159,6 +169,20 @@ Future showGenericErrorDialog({ buttonAction: ButtonAction.first, isInAlert: true, ), + if (isWindowCertError) + ButtonWidget( + buttonType: ButtonType.neutral, + labelText: 'Update Certificates', + buttonAction: ButtonAction.third, + isInAlert: true, + onTap: () async { + PlatformUtil.openWebView( + context, + context.l10n.faq, + "https://help.ente.io/auth/troubleshooting/windows-login", + ); + }, + ), ButtonWidget( buttonType: ButtonType.secondary, labelText: context.l10n.contactSupport,