Open sachinkaria opened 8 years ago
This works perfectly with signing IN.
Not sure if this is related but I had something similar, where after registration the login event was not emitted. Therefore I broadcast this event myself:
$rootScope.$on('auth:registration-email-success', function(event, user) {
$log.debug('event auth:registration-email-success: ' + user.email);
$rootScope.$broadcast('auth:login-success',user);
});
Then I use events to do the state change:
$rootScope.$on('auth:login-success', function(event, user) {
$log.debug('event auth:login-success');
// ensure $rootScope contains user object
$auth.validateUser().then(function(resp) {
$state.go('some_state');
});
});
+1 I have this issue with gem 'devise_token_auth' on my backend server
@abhayastudios In which part of your code did you do this? I think I have the same issue as my use is logged in but I can't go to another state. Although my app is in HTML and Java. But that is not important, I guess. I tried using those events but I think I am putting them in the wrong place in my code as they do not resolve my issue...
I haven't found a solution to this issue yet, the promises still don't resolve for sign-up and sign-out
I have managed to set up ng-token-auth to work with rails devise-token-auth. However when I try to sign up and then login the promise doesn't resolve even though the user is successfully created in the rails database. If the sign up promise resolves the user should automatically be logged in however it never executes this.
Here is my controller:
In this case submitLogin function is never executed even though a user is successfully created. Here is the rails feedback I get when creating a user:
If I manually redirect to the login page I can successfully login. This problem is also happening when I try signOut. The user successfully signs out of the rails API however the promise is not resolved in Angular and the page doesn't redirect.