I’ve been trying to set up Auth0 login within my Ioniv v1 project but it doesn’t seem to work with the steps given in documentation - https://auth0.com/docs/quickstart/native/ionic/01-login
After successful login and redirect to the app, the ‘onRedirectUri’ method never gets called. I also tried passing a callback to the ‘login’ function of my Auth0 service (where the login session is initiated) but that callback too, never gets fired.
It is really frustrating and I would appreciate if someone can quickly help me through this issue.
Below is the relevant code -
$ionicPlatform.ready(function () {
function handleUrl(url) {
console.log('open url ', url);
Auth0Cordova.onRedirectUri(url);
return $state.go('login');
}
window.handleOpenURL = handleUrl;
});
function login(callback) {
var client = new Auth0Cordova(auth0Config);
var options = {
scope: 'openid profile offline_access'
};
client.authorize(options, function (err, authResult) {
callback();
if (err) {
throw new Error(err);
}
if (authResult && authResult.accessToken && authResult.idToken) {
setSession(authResult);
$rootScope.$apply();
}
});
}