I’m using a Hosted Login Page with Custom UI, this means NO lock
My Client is an Angular 1.6 SPA with the angular-auth0 component
in auth.service.js I have
function authService($state, angularAuth0, $timeout, $cookies, $window) {
function login() {
angularAuth0.authorize();
}
the login.controller.js
function LoginController(authService) {
var vm = this;
vm.auth = authService;
}
and the view is a PUG(Jade) file
a.btn.btn-primary(
ng-click=“$ctrl.auth.login()”
aria-label=“Sign In”)
| Sign In
then the callback.js
function callbackController(angularAuth0, $timeout, $state) {
angularAuth0.parseHash(function(err, authResult) {
if (authResult && authResult.accessToken && authResult.idToken) {
_setSession(authResult);
$state.go(‘projects.list’, { location: ‘replace’ });
} else if (err) {
$timeout(function() {
$state.go(‘auth.login’);
});
console.log(err);
}
});
my app.config.js is
angularAuth0Provider.init({
clientID: authClientID,
domain: authDomain,
responseType: ‘token id_token’,
audience: ‘https://dev-valid8.auth0.com/userinfo’,
redirectUri: ‘http://localhost:9001/callback’,
scope: ‘openid’,
state: ‘xyzABC123’
});
How do I set/change the state?