-
Notifications
You must be signed in to change notification settings - Fork 234
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
User not logged in after email confirmation #18
Comments
Thanks @smarquez1, I'll look into this now. Which version of Devise do you have installed? |
devise 3.2.4, will also try devise 3.3.0. I think this have happened to me with older versions of the gem and ng library, but didn't have time to test. |
There's a known issue with devise 3.3.0 (documented here). It's probably safe to stick with 3.2.4 for now. |
Cool, your gem does'nt allow me to update devise (as it should) I'm using: |
@smarquez1 - there's a known issue with devise 3.3.0 so I locked the gem to I posted an issue with devise (heartcombo/devise#3163). Until the issue is resolved, this gem is not compatible with devise 3.3.x. |
@smarquez1 - I'm having trouble reproducing this bug. Can you please check the demo site and let me know if you can trigger the error there? |
It does work at the demo site. I'll try to reproduce it locally on the demo site |
@lynndylanhurley I tried using devise_token_auth_demo repo replacing my backend and the same happens, so my front-end must be misconfigured. |
Your rails logs indicate that everything is working on the backend. Can you post the code that you're using to subscribe to the |
Here you go: $scope.$on("auth:email-confirmation-success", function(ev, data) {
return $modal({
title: "Success!",
html: true,
content: "<div id='alert-email-confirmation-success'>Welcome " + data.email + ". Your account has been successfully created." + "</div>"
});
});
$scope.$on("auth:email-confirmation-error", function(ev, data) {
return $modal({
title: "Error!",
html: true,
content: "<div id='alert-email-confirmation-error'>Unable to confirm " +
"your account. Request a password reset to verify your identity." + "</div>"
});
}); |
@smarquez1 - I think I had a similar bug where it did not bind the events. Try setting |
This could be a scoping issue. Try using |
@markusklooth , @lynndylanhurley - Tried both solutions with no luck. It's like the event doesn't get propagated. |
@smarquez1 - it could be that the scope that is bound to the event doesn't exist when the event is fired. Does this code run inside of a controller? If so, are you sure that the controller is available when the Can you try binding the event within a run method? Something like this: angular.module('myApp')
.run(function($rootScope) {
$rootScope.$on("auth:email-confirmation-success", function(ev, data) {
$modal({
title: "Success!",
html: true,
content: "<div id='alert-email-confirmation-success'>Welcome " + data.email + ". Your account has been successfully created." + "</div>"
});
});
$rootScope.$on("auth:email-confirmation-error", function(ev, data) {
$modal({
title: "Error!",
html: true,
content: "<div id='alert-email-confirmation-error'>Unable to confirm " +
"your account. Request a password reset to verify your identity." + "</div>"
});
});
}); This will ensure that the code runs regardless of whether or not a controller is present. |
@lynndylanhurley - The code runs inside a controller. The controller is available. Using the code you wrote I still have the same problem. I know it's a lot to ask, but do you think you can take a look at my repo too see what's wrong? |
@smarquez1 - no problem!! Add me as a collaborator and I'll take a look ASAP. |
@lynndylanhurley - Invited! thanks so much for doing this |
@smarquez1 - I found the problem. It looks like angular is having trouble parsing the params from confirmation success redirect url. This is the current redirect url:
Everything works ok if the querystring is moved to the end:
I'll continue to investigate why this is happening, and what can be done to prevent this issue. I'll get back to you later this afternoon. |
@smarquez1 - I just pushed a commit to your repo that updates the devise_token_auth gem to version |
It works! Thank you very much @lynndylanhurley. Will keep reporting bugs. |
Great! Thanks @smarquez1! |
…for proper angularjs $location parsing. resolves lynndylanhurley#18.
Hi @lynndylanhurley , I used the devise_token_auth, but when I click the link from my mailbox, it cannot work. The confirmation is not finished. |
After registering a new user, and clicking on the confirmation link, the user is not logged in and the events 'auth:email-confirmation-success' , 'auth:email-confirmation-error' don't work.
The server does confirm the user and I can log in manually after this.
There are no visible js errors. Here's the rails output.
The text was updated successfully, but these errors were encountered: