diff --git a/packages/deriv_web_view/lib/deriv_web_view.dart b/packages/deriv_web_view/lib/deriv_web_view.dart index 0a0fd2dc1..8580ac4e7 100644 --- a/packages/deriv_web_view/lib/deriv_web_view.dart +++ b/packages/deriv_web_view/lib/deriv_web_view.dart @@ -153,6 +153,7 @@ Future openLoggedInWebPage({ required bool rootNavigator, required String appToken, required String userAgent, + required String platform, HttpClientPredicate? getHttpClient, String destinationAppId = '16929', String? action, @@ -177,6 +178,7 @@ Future openLoggedInWebPage({ getHttpClient: getHttpClient, action: action, code: code, + platform: platform, ); if (oneTimeToken == null) { @@ -216,6 +218,7 @@ Future openLoggedInWebPage({ getHttpClient: getHttpClient, action: action, code: code, + platform: platform, ); } @@ -245,6 +248,7 @@ Future _fetchOneTimeToken({ required void Function(BuildContext context) loadingDialog, required bool rootNavigator, required String appToken, + required String platform, HttpClientPredicate? getHttpClient, String? action, String? code, @@ -262,6 +266,7 @@ Future _fetchOneTimeToken({ action: action, code: code, getHttpClient: getHttpClient, + platform: platform, ); Navigator.of(context, rootNavigator: rootNavigator).pop(); @@ -278,6 +283,7 @@ Future _getOneTimeToken({ required String? refreshToken, required String? defaultAccount, required String appToken, + required String platform, HttpClientPredicate? getHttpClient, String? action, String? code, @@ -294,6 +300,7 @@ Future _getOneTimeToken({ action: action, code: code, getHttpClient: getHttpClient, + platform: platform, ); return token; @@ -311,6 +318,7 @@ Future _validateCredentials({ required String appId, required String destinationAppId, required String? refreshToken, + required String platform, required String? defaultAccount, required void Function(BuildContext context) loadingDialog, required Future Function(BuildContext context) tokenExpiredDialog, @@ -334,6 +342,7 @@ Future _validateCredentials({ getHttpClient: getHttpClient, action: action, code: code, + platform: platform, ); if (oneTimeToken == null) { diff --git a/packages/deriv_web_view/lib/helper.dart b/packages/deriv_web_view/lib/helper.dart index 1c13c942e..37a4ed291 100644 --- a/packages/deriv_web_view/lib/helper.dart +++ b/packages/deriv_web_view/lib/helper.dart @@ -22,6 +22,7 @@ Future performPassThroughAuthentication({ required String endpoint, required String appId, required String appToken, + required String platform, HttpClientPredicate? getHttpClient, String? action, String? code, @@ -43,6 +44,7 @@ Future performPassThroughAuthentication({ urlParams: UrlParamsModel( redirectUrl: redirectPath, selectedAccount: defaultAccount ?? '', + platform: platform, action: action, code: code, ), diff --git a/packages/deriv_web_view/lib/models/pta_login_request_model.dart b/packages/deriv_web_view/lib/models/pta_login_request_model.dart index 887385099..4dfee0910 100644 --- a/packages/deriv_web_view/lib/models/pta_login_request_model.dart +++ b/packages/deriv_web_view/lib/models/pta_login_request_model.dart @@ -30,6 +30,7 @@ class UrlParamsModel { UrlParamsModel({ required this.redirectUrl, required this.selectedAccount, + required this.platform, this.action, this.code, }); @@ -40,6 +41,9 @@ class UrlParamsModel { /// Login Id of account. final String selectedAccount; + /// Platform. + final String platform; + /// The action that caused redirect for example `passthrough_authentication`. final String? action; @@ -52,6 +56,6 @@ class UrlParamsModel { 'selected_acct': selectedAccount, if (action != null) 'action': action, if (code != null) 'code': code, - 'platform': 'derivgo', + 'platform': platform, }; }