I’m trying to add a Patreon login to my React Native app and I have it almost working – I set up a custom social connection using this post and installed the Auth0 react native library, so far so good.
When I call authorize({}, {})
I get the vague error “An error occurred when trying to authenticate with the server.” although it seems like the OAuth works, I get redirected to the Auth0 page, click the button to go to Patreon, then on Patreon click Allow to grant access. But when I get redirected back to my app user
is null and I have the aforementioned error message.
My code’s pretty straightforward:
const Patreon = (props) => {
const {authorize, clearSession, user, getCredentials, error, isLoading} = useAuth0();
const login = async () => {
try {
await authorize({}, {});
const credentials = await getCredentials();
// console.warn(credentials);
} catch (e) {
console.warn(e);
}
}
const logout = async () => {
try {
await clearSession();
} catch (e) {
console.log(e);
}
}
console.warn(error);
return <View>
<Button title="Patreon Login" onPress={login} />
<Button title="Logout" onPress={logout} />
</View>
}
Package wise I have
- react-native: 0.72.3
- react-native-auth0: 3.0.1
Is there any way to get more logging out of the login process? Everything seems to be set up correctly so I have no idea what this error means.