I am trying to save a password using keytar.js, for some reason I keep getting this error when using ANY function from keytar.
For information : the lib. is installed and the functions are there and present (I checked using console.log) and they work just fine with catch().
Here is some code :
const keytar = require("keytar");
I am using it in a componentDidMount() function from react,
I tried these 2 versions but none of them seems to be working :
keytar
.setPassword("stoma", "user", user)
.then(() => {
console.log("User .. OK !");
})
.catch(() => {
console.log("User .. ERROR !");
ok = false;
})
and
keytar.setPassword("stoma", "statut", "true");
Here's some error log too :
keytar.js:38 Uncaught (in promise) TypeError: keytar.setPassword is not a function
at keytar.js:38
at keytar.js:12
at new Promise (<anonymous>)
at callbackPromise (keytar.js:11)
at Object.setPassword (keytar.js:37)
at _callee$ (Login.js:52)
at tryCatch (runtime.js:62)
at Generator.invoke [as _invoke] (runtime.js:288)
at Generator.prototype.(:3000/anonymous function) [as next] (http://localhost:3000/static/js/0.chunk.js:1881:21)
at asyncGeneratorStep (asyncToGenerator.js:3)
at _next (asyncToGenerator.js:25)
at asyncToGenerator.js:32
at new Promise (<anonymous>)
at asyncToGenerator.js:21
at _validate (Login.js:48)
at validate (Login.js:48)
If some can help , I would be grateful.Thank you.