Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deriv_auth): Fix_passkeys_logout_issue #653

Closed
14 changes: 11 additions & 3 deletions packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,15 @@ class DerivAuthCubit extends Cubit<DerivAuthState>
}

@override
Future<void> tokenLogin(String token) async {
Future<void> tokenLogin(
String token, [
String? refreshToken,
]) async {
emit(DerivAuthLoadingState());

await _tokenLoginRequest(
token,
refreshToken: refreshToken,
accounts: await authService.getLatestAccounts(),
);
}
Expand Down Expand Up @@ -142,11 +146,15 @@ class DerivAuthCubit extends Cubit<DerivAuthState>

Future<void> _tokenLoginRequest(
String token, {
String? refreshToken,
required List<AccountModel> 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);
Expand Down
Loading