|
| 1 | +diff --git a/cozy/lib/cozy_config_manager/cozy_config_manager_web.dart b/cozy/lib/cozy_config_manager/cozy_config_manager_web.dart |
| 2 | +index 03da73f1e..b518b19ef 100644 |
| 3 | +--- a/cozy/lib/cozy_config_manager/cozy_config_manager_web.dart |
| 4 | ++++ b/cozy/lib/cozy_config_manager/cozy_config_manager_web.dart |
| 5 | +@@ -14,6 +14,7 @@ class CozyConfigManager { |
| 6 | + } |
| 7 | + |
| 8 | + Future<bool> get isInsideCozy async { |
| 9 | ++ return true; |
| 10 | + return _isInsideCozy ??= await _checkCozyEnvironment(); |
| 11 | + } |
| 12 | + |
| 13 | +diff --git a/env.file b/env.file |
| 14 | +index 77b662611..2c60bb1a1 100644 |
| 15 | +--- a/env.file |
| 16 | ++++ b/env.file |
| 17 | +@@ -1,6 +1,6 @@ |
| 18 | +-SERVER_URL=http://localhost/ |
| 19 | +-DOMAIN_REDIRECT_URL=http://localhost:3000 |
| 20 | +-WEB_OIDC_CLIENT_ID=teammail-web |
| 21 | ++SERVER_URL=https://jmap.lin-saas.dev |
| 22 | ++DOMAIN_REDIRECT_URL=http://localhost:2023 |
| 23 | ++WEB_OIDC_CLIENT_ID=teammail-web-dev |
| 24 | + OIDC_SCOPES=openid,profile,email,offline_access |
| 25 | + APP_GRID_AVAILABLE=supported |
| 26 | + FCM_AVAILABLE=supported |
| 27 | +@@ -8,4 +8,4 @@ IOS_FCM=supported |
| 28 | + FORWARD_WARNING_MESSAGE= |
| 29 | + PLATFORM=other |
| 30 | + WS_ECHO_PING= |
| 31 | +-COZY_INTEGRATION= |
| 32 | +\ No newline at end of file |
| 33 | ++COZY_INTEGRATION=true |
| 34 | +\ No newline at end of file |
| 35 | +diff --git a/lib/features/home/presentation/extensions/handle_web_finger_to_get_token_extension.dart b/lib/features/home/presentation/extensions/handle_web_finger_to_get_token_extension.dart |
| 36 | +index a51b1a9d2..7d8734e0c 100644 |
| 37 | +--- a/lib/features/home/presentation/extensions/handle_web_finger_to_get_token_extension.dart |
| 38 | ++++ b/lib/features/home/presentation/extensions/handle_web_finger_to_get_token_extension.dart |
| 39 | +@@ -2,11 +2,11 @@ import 'package:core/presentation/state/failure.dart'; |
| 40 | + import 'package:core/utils/platform_info.dart'; |
| 41 | + import 'package:dartz/dartz.dart'; |
| 42 | + import 'package:model/oidc/oidc_configuration.dart'; |
| 43 | +-import 'package:model/oidc/request/oidc_request.dart'; |
| 44 | + import 'package:model/oidc/response/oidc_response.dart'; |
| 45 | + import 'package:tmail_ui_user/features/home/presentation/home_controller.dart'; |
| 46 | ++import 'package:tmail_ui_user/features/login/data/network/oidc_error.dart'; |
| 47 | + import 'package:tmail_ui_user/features/login/domain/exceptions/authentication_exception.dart'; |
| 48 | +-import 'package:tmail_ui_user/features/login/domain/model/base_url_oidc_response.dart'; |
| 49 | ++import 'package:tmail_ui_user/features/login/domain/state/check_oidc_is_available_state.dart'; |
| 50 | + import 'package:tmail_ui_user/features/login/domain/state/get_oidc_configuration_state.dart'; |
| 51 | + import 'package:tmail_ui_user/features/login/domain/state/get_token_oidc_state.dart'; |
| 52 | + import 'package:tmail_ui_user/main/utils/app_config.dart'; |
| 53 | +@@ -21,9 +21,7 @@ extension HandleWebFingerToGetTokenExtension on HomeController { |
| 54 | + if (baseUri == null) { |
| 55 | + goToLogin(); |
| 56 | + } else { |
| 57 | +- consumeState( |
| 58 | +- checkOIDCIsAvailableInteractor.execute(OIDCRequest.fromUri(baseUri)), |
| 59 | +- ); |
| 60 | ++ handleFailureViewState(CheckOIDCIsAvailableFailure(CanNotFoundOIDCLinks())); |
| 61 | + } |
| 62 | + } |
| 63 | + |
| 64 | +@@ -58,7 +56,7 @@ extension HandleWebFingerToGetTokenExtension on HomeController { |
| 65 | + } |
| 66 | + |
| 67 | + void tryGetOIDCConfigurationFromBaseUri(Uri baseUri) { |
| 68 | +- getOIDCConfiguration(BaseUrlOidcResponse(baseUri)); |
| 69 | ++ handleFailureViewState(GetOIDCConfigurationFromBaseUrlFailure(null)); |
| 70 | + } |
| 71 | + |
| 72 | + bool isGetTokenOIDCFailure(Failure? failure) { |
| 73 | +diff --git a/lib/features/login/presentation/extensions/handle_openid_configuration.dart b/lib/features/login/presentation/extensions/handle_openid_configuration.dart |
| 74 | +index d8b35fd1b..f1c4ca3c4 100644 |
| 75 | +--- a/lib/features/login/presentation/extensions/handle_openid_configuration.dart |
| 76 | ++++ b/lib/features/login/presentation/extensions/handle_openid_configuration.dart |
| 77 | +@@ -1,11 +1,11 @@ |
| 78 | + |
| 79 | +-import 'package:tmail_ui_user/features/login/domain/model/base_url_oidc_response.dart'; |
| 80 | ++import 'package:tmail_ui_user/features/login/domain/state/get_oidc_configuration_state.dart'; |
| 81 | + import 'package:tmail_ui_user/features/login/presentation/login_controller.dart'; |
| 82 | + |
| 83 | + extension HandleOpenidConfiguration on LoginController { |
| 84 | + |
| 85 | + void tryGetOIDCConfigurationFromBaseUrl(Uri baseUri) { |
| 86 | +- getOIDCConfiguration(BaseUrlOidcResponse(baseUri)); |
| 87 | ++ handleFailureViewState(GetOIDCConfigurationFromBaseUrlFailure(null)); |
| 88 | + } |
| 89 | + |
| 90 | + void handleGetOIDCConfigurationFromBaseUrlFailure() { |
| 91 | +diff --git a/lib/features/login/presentation/login_controller.dart b/lib/features/login/presentation/login_controller.dart |
| 92 | +index ec41a9e7a..15b4864c6 100644 |
| 93 | +--- a/lib/features/login/presentation/login_controller.dart |
| 94 | ++++ b/lib/features/login/presentation/login_controller.dart |
| 95 | +@@ -15,7 +15,6 @@ import 'package:jmap_dart_client/jmap/core/session/session.dart'; |
| 96 | + import 'package:jmap_dart_client/jmap/core/user_name.dart'; |
| 97 | + import 'package:model/account/password.dart'; |
| 98 | + import 'package:model/oidc/oidc_configuration.dart'; |
| 99 | +-import 'package:model/oidc/request/oidc_request.dart'; |
| 100 | + import 'package:model/oidc/response/oidc_response.dart'; |
| 101 | + import 'package:tmail_ui_user/features/base/reloadable/reloadable_controller.dart'; |
| 102 | + import 'package:tmail_ui_user/features/home/domain/state/auto_sign_in_via_deep_link_state.dart'; |
| 103 | +@@ -340,16 +339,7 @@ class LoginController extends ReloadableController { |
| 104 | + } |
| 105 | + |
| 106 | + void _checkOIDCIsAvailable() { |
| 107 | +- if (_currentBaseUrl == null) { |
| 108 | +- dispatchState(Left(CheckOIDCIsAvailableFailure(CanNotFoundBaseUrl()))); |
| 109 | +- } else { |
| 110 | +- consumeState(_checkOIDCIsAvailableInteractor.execute( |
| 111 | +- OIDCRequest( |
| 112 | +- baseUrl: _currentBaseUrl!.toString(), |
| 113 | +- resourceUrl: _currentBaseUrl!.origin |
| 114 | +- ) |
| 115 | +- )); |
| 116 | +- } |
| 117 | ++ handleFailureViewState(CheckOIDCIsAvailableFailure(CanNotFoundOIDCLinks())); |
| 118 | + } |
| 119 | + |
| 120 | + void handleBackButtonAction(BuildContext context) { |
0 commit comments