TF-2271 Replace string to object for Username & Password
(cherry picked from commit 7958557b9d4787aa5a319267a57b93ccc753c59e)
This commit is contained in:
@@ -14,10 +14,6 @@ class ResponsiveUtils {
|
||||
static const int minTabletWidth = 600;
|
||||
static const int minTabletLargeWidth = 900;
|
||||
|
||||
static const double _loginTextFieldWidthSmallScreen = 280.0;
|
||||
static const double _loginTextFieldWidthLargeScreen = 320.0;
|
||||
static const double _loginButtonWidth = 240.0;
|
||||
|
||||
static const double tabletHorizontalMargin = 120.0;
|
||||
static const double tabletVerticalMargin = 200.0;
|
||||
static const double desktopVerticalMargin = 120.0;
|
||||
@@ -63,11 +59,6 @@ class ResponsiveUtils {
|
||||
isPortrait(context);
|
||||
}
|
||||
|
||||
double getWidthLoginTextField(BuildContext context) =>
|
||||
isMobile(context) ? _loginTextFieldWidthSmallScreen : _loginTextFieldWidthLargeScreen;
|
||||
|
||||
double getWidthLoginButton() => _loginButtonWidth;
|
||||
|
||||
bool isHeightShortest(BuildContext context) {
|
||||
return MediaQuery.of(context).size.shortestSide < heightShortest;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ abstract class ReloadableController extends BaseController {
|
||||
sessionRemoteException: failure.remoteException
|
||||
);
|
||||
} else if (failure is GetStoredTokenOidcFailure) {
|
||||
goToLogin(arguments: LoginArguments(LoginFormType.ssoForm));
|
||||
goToLogin(arguments: LoginArguments(LoginFormType.none));
|
||||
} else if (failure is GetAuthenticatedAccountFailure) {
|
||||
goToLogin(arguments: LoginArguments(LoginFormType.credentialForm));
|
||||
}
|
||||
@@ -77,12 +77,12 @@ abstract class ReloadableController extends BaseController {
|
||||
dynamicUrlInterceptors.setJmapUrl(credentialViewState.baseUrl.origin);
|
||||
dynamicUrlInterceptors.changeBaseUrl(credentialViewState.baseUrl.origin);
|
||||
authorizationInterceptors.setBasicAuthorization(
|
||||
credentialViewState.userName.value,
|
||||
credentialViewState.password.value,
|
||||
credentialViewState.userName,
|
||||
credentialViewState.password,
|
||||
);
|
||||
authorizationIsolateInterceptors.setBasicAuthorization(
|
||||
credentialViewState.userName.value,
|
||||
credentialViewState.password.value,
|
||||
credentialViewState.userName,
|
||||
credentialViewState.password,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import 'dart:io';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:get/get_connect/http/src/request/request.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:model/account/password.dart';
|
||||
import 'package:model/account/personal_account.dart';
|
||||
import 'package:model/account/authentication_type.dart';
|
||||
import 'package:model/oidc/oidc_configuration.dart';
|
||||
@@ -38,8 +40,8 @@ class AuthorizationInterceptors extends QueuedInterceptorsWrapper {
|
||||
this._accountCacheManager
|
||||
);
|
||||
|
||||
void setBasicAuthorization(String? userName, String? password) {
|
||||
_authorization = base64Encode(utf8.encode('$userName:$password'));
|
||||
void setBasicAuthorization(UserName userName, Password password) {
|
||||
_authorization = base64Encode(utf8.encode('${userName.value}:${password.value}'));
|
||||
_authenticationType = AuthenticationType.basic;
|
||||
}
|
||||
|
||||
|
||||
@@ -164,8 +164,8 @@ class SendingEmailWorker extends Worker {
|
||||
void _handleGetAccountByBasicAuthSuccess(GetCredentialViewState credentialViewState) {
|
||||
_dynamicUrlInterceptors?.setJmapUrl(credentialViewState.baseUrl.toString());
|
||||
_authorizationInterceptors?.setBasicAuthorization(
|
||||
credentialViewState.userName.value,
|
||||
credentialViewState.password.value,
|
||||
credentialViewState.userName,
|
||||
credentialViewState.password,
|
||||
);
|
||||
_dynamicUrlInterceptors?.changeBaseUrl(credentialViewState.baseUrl.toString());
|
||||
_getSessionAction();
|
||||
|
||||
@@ -256,8 +256,8 @@ class FcmMessageController extends FcmBaseController {
|
||||
log('FcmMessageController::_handleGetAccountByBasicAuthSuccess():');
|
||||
_dynamicUrlInterceptors?.setJmapUrl(credentialViewState.baseUrl.toString());
|
||||
_authorizationInterceptors?.setBasicAuthorization(
|
||||
credentialViewState.userName.value,
|
||||
credentialViewState.password.value,
|
||||
credentialViewState.userName,
|
||||
credentialViewState.password,
|
||||
);
|
||||
if (FcmUtils.instance.isMobileAndroid) {
|
||||
_dynamicUrlInterceptors?.changeBaseUrl(credentialViewState.baseUrl.toString());
|
||||
|
||||
Reference in New Issue
Block a user