-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$auth.submitLogin callback don't fire #51
Comments
Thanks @m2omou, I'll look into this ASAP. |
Might be helpful to see your full controller code too. |
After many trials It's working fine now, I don't really know what was the problem but it's working. I put the .run() above the .config() maybe that's the reason... :) |
Cool, thanks @m2omou. I couldn't reproduce this one, but please re-open this issue if the problem recurs. |
I'm having the same issue here TypeError: Cannot read property 'resolve' of null
at Object.resolveDfd (ng-token-auth.js:374)
at Object.handleValidAuth (ng-token-auth.js:572)
at ng-token-auth.js:190
at angular.js:10296
at processQueue (angular.js:14792)
at angular.js:14808
at Scope.$eval (angular.js:16052)
at Scope.$digest (angular.js:15870)
at Scope.scopePrototype.$digest (hint.js:1972)
at Scope.$apply (angular.js:16160)(anonymous function) @ angular.js:12520
angular.js:10765 XHR finished loading: GET "http://app.dev-myapp.io:8090/app/backend/toolbar/layouts/vertical-navigation/toolbar.html".(anonymous function) @ angular.js:10765sendReq @ angular.js:10558serverRequest @ angular.js:10268processQueue @ angular.js:14792(anonymous function) @ angular.js:14808Scope.$eval @ angular.js:16052Scope.$digest @ angular.js:15870scopePrototype.$digest @ hint.js:1972Scope.$apply @ angular.js:16160scopePrototype.$apply @ hint.js:2035(anonymous function) @ angular.js:17927completeOutstandingRequest @ angular.js:5552(anonymous function) @ angular.js:5829 Usually you have to submit twice to log in. |
@mustela I am experiencing the same problem. Did you find a solution? |
@carlospliego yes and no :) I'm using https://github.com/lynndylanhurley/devise_token_auth, so after changing Hope that helps |
@lynndylanhurley it seems @nbrustein has a commit that references this, not sure if it has fixed anything or if there was a pull request for this. |
I'm experiencing the same issue. @mustela @carlospliego @lynndylanhurley did you find any solution? I'm using https://github.com/lynndylanhurley/devise_token_auth as well and setting
In the initializer didn't help.
I cleared my controller to debug so all I'm left is with a call to:
Acording to my rails logs the posts gets to '/api/v1/auth/sign_in' and it gives a 200 back with the info. I've tried with postman and the requests do work. |
@marcguilera as you said, at the beginning I thought that changing I'm keep looking for answers. Will post as soon as I have something. |
Registrations works and the validation event gets triggered giving me the user that I attempted to log in earlier which is weird because it failed apparently. Thanks! |
I had the same issue and solved it. The problem is the way you are calling the function within your controller. Paste it and I ll show you. |
I have same issue here. Any resolution? |
Any resolutions? |
I figured out at least one reason why this occurs. My error was that I was simultaneously calling submitLogin in a controller method on an ng-click of the submit button AND had the submitLogin() in the ng-submit of the form definition. This caused the submit to occur twice in rapid succession. Apparently the ng-click gets handled first which means the promise handed back from submitLogin is from the ng-click. Since the deferred is a global within ng-token-auth the first one gets clobbered when the second one (the one from the ng-submit) occurs and only the second one is resolved. Check your network log and see if you happen to be submitting two auth requests in rapid succession for some reason. That could be where the root of the problem for some people. |
It works fine with $auth.submitRegistration but not with $auth.submitLogin.
This is what I get in my browser console
I can see that the login works well in the server, here is the rails server logs
The text was updated successfully, but these errors were encountered: