diff --git a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart index 6b7db78de..3fffed192 100644 --- a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart +++ b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart @@ -100,11 +100,15 @@ class DerivAuthCubit extends Cubit } @override - Future tokenLogin(String token) async { + Future tokenLogin( + String token, [ + String? refreshToken, + ]) async { emit(DerivAuthLoadingState()); await _tokenLoginRequest( token, + refreshToken: refreshToken, accounts: await authService.getLatestAccounts(), ); } @@ -142,11 +146,15 @@ class DerivAuthCubit extends Cubit Future _tokenLoginRequest( String token, { + String? refreshToken, required List accounts, }) async { try { - final AuthorizeEntity authorizeEntity = - await authService.login(token, accounts: accounts); + final AuthorizeEntity authorizeEntity = await authService.login( + token, + refreshToken: refreshToken, + accounts: accounts, + ); final LandingCompanyEntity landingCompanyEntity = await authService.getLandingCompany(authorizeEntity.country); _isUserMigrated = _checkUserMigrated(authorizeEntity);