react-native-app-auth: Cannot read property 'authorize' of undefined
I get TypeError: Cannot read property 'authorize' of undefined with this setup
import { authorize as auth } from 'react-native-app-auth';
const config = {
clientId: 'app-id',
clientSecret: 'super-secret',
redirectUrl: 'com.app://redirect',
scopes: ['activity', 'sleep'],
serviceConfiguration: {
authorizationEndpoint: 'https://domain/authorize',
tokenEndpoint: 'https://domain.tld/token',
revocationEndpoint: 'https://domain.tld/revoke'
}
};
auth(config).then(result => {
console.log(result);
}).catch(e => {
console.error(e);
});
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 21 (7 by maintainers)
Any update on this? I am still facing the issue on IOS simulator. I have tried everything mentioned in this thread still no success
Hi @arjunpathy 👋 - this error is always to do with misconfiguration. Make sure you’ve followed the setup instructions,
react-native linked, and rebuilt your app withreact-native run-iosorreact-native run-android.