Giter Site home page Giter Site logo

Comments (11)

oblador avatar oblador commented on June 23, 2024

@vonovak: care to look at this?

from react-native-keychain.

codyhazelwood avatar codyhazelwood commented on June 23, 2024

The code that causes the issue:

const Config = {portalUrl: 'https://www.myurl.com/'};
...
    componentDidMount() {
        ....
        Keychain.getInternetCredentials(Config.portalUrl)
            .then(credentials => {
                let {username: email, password} = credentials;
                this.setState({email, password});
            });
    }

    _signIn() {
        Auth.signIn(this.state.email, this.state.password)
            .then(user => {
                if (user) {
                    ....
                    // Save login info
                    Keychain.setInternetCredentials(
                        Config.portalUrl,
                        this.state.email,
                        this.state.password
                    ).catch(err => console.error(err));
                }
            })
    }

Not sure that these logs are too helpful, but here they are.

Logs in v0.3.0 for getInternetCredentials:

05-31 18:37:26.469 23797 24840 D KeychainModule : will attempt to decrypt for https://www.myurl.com/AQL2cswUfqA18qpsjApUJdf5tlJnM/B0eEWQ2XirtXDSlLI+SrdHKH3mYlk4idiAelmwWgM=
05-31 18:37:26.469 23797 24840 D KeychainModule : :AQJd2LLAUciJghFPh53t6f41Kdk7xt2J0tqc5ZSnB41QsEVLYqw=
05-31 18:37:26.512 23797 24839 I ReactNativeJS: 'convertError@http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:112986:17\nhttp://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:112883:20\n__invokeCallback@http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:6760:15\nhttp://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:6643:24\nguard@http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:6588:3\ninvokeCallbackAndReturnFlushedQueue@http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:6642:6\ninvokeCallbackAndReturnFlushedQueue@[native code]\nglobal code'
05-31 18:37:26.513 23797 24839 E ReactNativeJS: [Error: Error]
05-31 18:37:26.520 23797 24840 E unknown:React: Error, stack:
05-31 18:37:26.520 23797 24840 E unknown:React: convertError@112986:17
05-31 18:37:26.520 23797 24840 E unknown:React: <unknown>@112883:20
05-31 18:37:26.520 23797 24840 E unknown:React: __invokeCallback@6760:15
05-31 18:37:26.520 23797 24840 E unknown:React: <unknown>@6643:24
05-31 18:37:26.520 23797 24840 E unknown:React: guard@6588:3
05-31 18:37:26.520 23797 24840 E unknown:React: invokeCallbackAndReturnFlushedQueue@6642:6

Logs in my branch for getInternetCredentials:

05-31 19:00:00.737 31125 31180 D KeychainModule : will attempt to decrypt for https://www.myurl.com/AQJ4cojg/0e7HOtsRCuvSELsHD2dCNBE/Bu5U9WBuFN/Aj1L74bS/A9b5tUTuX6kFEuLDIQ=
05-31 19:00:00.737 31125 31180 D KeychainModule : :AQJznomEHe5kav/afbJUxc5u+suv47bzc/3gjwyn8zl3XM5w6sI=

from react-native-keychain.

vonovak avatar vonovak commented on June 23, 2024

bummer. @codyhazelwood this happens when no credentails are saved or are they there and it fails when decrypting? i see they are there
[Error: Error] helpful :D

from react-native-keychain.

vonovak avatar vonovak commented on June 23, 2024

@codyhazelwood do you have the libconceal libraries in build directory?
running git diff on my branch and yours shown only this one change - removal of the libconceal libraries from android lib directory and the change in converError. I suppose they would install from maven during android build..
..or is the problem with the convertError method? will take a look

does your branch work with the latest commit that changed the converError method?

from react-native-keychain.

vonovak avatar vonovak commented on June 23, 2024

@codyhazelwood did you test after changing

  if (Platform.OS === 'android') {
      return err;
  }

to

  if (Platform.OS === 'android') {
      return new Error(err);
  }

? It works for me when I revert the change, i.e. the first snippet works. although I'm using genericPassword not internetPassword but that can't make a difference

@oblador https://github.com/oblador/react-native-keychain/blob/master/index.js#L44 any reason why convertError is called twice?

from react-native-keychain.

oblador avatar oblador commented on June 23, 2024

@vonovak: no that looks like a bug to me.

from react-native-keychain.

oblador avatar oblador commented on June 23, 2024

This module is pretty ripe for a refactor tbh :-) Would like to use native promise support instead for example which would make the codebase cleaner, do automatic error conversion and even provide a native stack trace. Will break some backwards compatibility though, but likely not an issue.

from react-native-keychain.

vonovak avatar vonovak commented on June 23, 2024

@codyhazelwood try the index.js file from my android branch.. it works for me.

from react-native-keychain.

codyhazelwood avatar codyhazelwood commented on June 23, 2024

Sorry, I just noticed when I was testing that I had locked my package.json to the commit before, without the error handling change. @vonovak your latest index.js works fine.

from react-native-keychain.

vonovak avatar vonovak commented on June 23, 2024

PR #22

from react-native-keychain.

oblador avatar oblador commented on June 23, 2024

Released as 0.3.1

from react-native-keychain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.