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

The new biometricCheck AuthStatus and logic based on it is implemented (KIDS-748) #659

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

pavelpavelko
Copy link
Contributor

Description

@github-actions github-actions bot added the bug Something isn't working label Apr 5, 2024
Comment on lines 55 to 67

final biometricSetting = await BiometricsHelper.getBiometricSetting();

emit(
state.copyWith(
status: AuthStatus.authenticated,
status: biometricSetting == BiometricSetting.unknown
? AuthStatus.biometricCheck
: AuthStatus.authenticated,
user: userExt,
session: session,
navigate: navigate,
),
);
Copy link
Contributor

@Daniela510 Daniela510 Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Styling opinion but i would wrap the emit in a guarded if statement like

If (biometricSetting == BiometricSetting.unknown){
     emit(
        state.copyWith(
          status: AuthStatus.biometricCheck,
          user: userExt,
          session: session,
          navigate: navigate,
        ),
      );
      
   return;
 }

I think its easier to follow, but its just an opinion 🦐

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps, but in this case we will have two emits, so not sure what is better)

void clearNavigation() => emit(
state.copyWith(
status: state.status,
navigate: AuthState._emptyNavigate,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, why does _emptyNavigate have an underscore, when it isnt private 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's private for AuthCubit/AuthState so cannot be accessed outside

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh never digested that cubit and state share private classes, cool!

@pavelpavelko pavelpavelko merged commit b8c27b3 into develop Apr 5, 2024
1 check passed
@pavelpavelko pavelpavelko deleted the bug/kids-748-biometrics-issue branch April 5, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants