Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Pending auth props, fixes #137
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Mar 27, 2019
1 parent 7ce776f commit 88f360e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/screens/Root.js
Expand Up @@ -212,10 +212,21 @@ export default class Root extends Abstract {

this.authenticationInProgress = true;

if(this.pendingAuthProps) {
// Existing unvalidated auth props. Don't use input authProps.
// This is to handle the case on Android where if a user has both fingerprint (immediate) and passcode (on quit),
// they can press the physical back button on launch to dismiss auth window, then come back into app, and it will only ask for fingerprint.
// We'll clear pendingAuthProps on success
authProps = this.pendingAuthProps;
} else {
this.pendingAuthProps = authProps;
}

this.props.navigation.navigate("Authenticate", {
authenticationSources: authProps.sources,
onSuccess: () => {
authProps.onAuthenticate();
this.pendingAuthProps = null;
this.authenticationInProgress = false;
if(this.dataLoaded) {
Sync.get().sync();
Expand Down

0 comments on commit 88f360e

Please sign in to comment.