auth0 / react-native-lock

[DEPRECATED] A wrapper of Lock to use with React Native (iOS & Android)
MIT License
277 stars 77 forks source link

Profile object returning empty for user metadata on iOS #122

Open wspringe opened 7 years ago

wspringe commented 7 years ago

Hello,

I am having an issue where the user metadata is empty in the profile object on iOS. It is currently working on android and both platforms are using my same code. I am using roles in this case as the only item in the user metadata.

I am using the same code provided in the tutorial.

lock.show({
  closable: true,
}, (err, profile, token) => {
  if (err) {
    console.log(err);
    return;
  }
  this.props.navigator.push({screen: 'MainMenu',
  //passes props from auth0 user info to next screen
  passProps: {
    profile: profile,
    token: token,
  }

Any help is appreciated!

hzalaz commented 7 years ago

@wspringe can you paste how you are using metadata? it should be available with profile.userMetadata

wspringe commented 7 years ago

@hzalaz Thanks for the response! I am using it like this:

<Text style={styles.hintText}>{this.props.profile.roles}</Text>

This works when using an android emulator, but not when using the iOS simulator. It returns an empty string. I also tried {this.props.profile.userMetadata} and {this.props.profile.userMetadata.roles} and they both still returned empty string and return an error.