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

Command save: unable to make userAuthenticationRequired work #49

Open
Muzietto opened this issue Aug 3, 2018 · 4 comments
Open

Command save: unable to make userAuthenticationRequired work #49

Muzietto opened this issue Aug 3, 2018 · 4 comments

Comments

@Muzietto
Copy link

Muzietto commented Aug 3, 2018

I am trying to use save on IOS.

My call is:

window.plugins.touchid.save(
  "MyAppID",
  "PasswordGivenInAPasswordPrompt",
   true,
   successCallback,
   errorCallback
)

function successCallback() {console.log('success')}
function errorCallback(err) {console.log('error', err)}

I get systematically the error Error in Success callback: TouchID xyz - Type Error: callback.success.call is not a function

If I remove the true in the third position, everything is fine.

It appears that the documentation about save is wrong: the third boolean param userAuthenticationRequired seems to be no longer in place and the two places in the docs where it is mentioned and taken as example should be amended.

@MatthewPringle
Copy link

I have just noticed the same, yet the code in the repo seems fine

save: function(key,password, userAuthenticationRequired, successCallback, errorCallback) {
exec(successCallback, errorCallback, "TouchID", "save", [key,password, userAuthenticationRequired]);
},

@VDGone
Copy link

VDGone commented Oct 1, 2018

If you use the last release version (3.2.1), just remove the "true" value after "PasswordGivenInAPasswordPrompt".

window.plugins.touchid.save( "MyAppID", "PasswordGivenInAPasswordPrompt", successCallback, errorCallback )

@edubskiy
Copy link

I think if you do this and enrolls your finger/face successfully you will always get errorCallback(message), where message equals "success".

@ukenpachi
Copy link

the npm library has changed so what is userAuthenticationRequired for?

 /**
     * Encrypts and Saves a password under the key in the device keychain, which can be retrieved after
     * successful authentication using fingerprint
     * @param key {string} the key you want to store
     * @param password {string} the password you want to encrypt and store
     * @return {Promise<any>} Returns a promise that resolves when there is a result
     */
    save(key: string, password: string, userAuthenticationRequired: boolean): Promise<any>;

the comment does not say what it is for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants