-
Notifications
You must be signed in to change notification settings - Fork 5
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
Upgrading to newest javascript file constantly redirects to sign-in #22
Comments
Also, below is a screenshot from my rails console. When I enter the correct login info, I do get a Completed 201 for the "/users/sign_in" request, and a Completed 200 OK for the "/sessions/current" request; however, nothing happens in the browser, nor are any messages are sent to the console after logging in (sending the action "signIn" request via login button) |
@jasoncartermartin hey Jason, how does your
|
@jasoncartermartin to add on to @abuiles suggestion, also make sure you have |
Thanks for the quick response @abuiles and @joefiorini! Apologies for the delay in my response, I have been traveling extensively this week. @joefiorini: Thanks for the skipsAuthentication tip; I'm currently just trying this on a route that I do want to be protected, but I'll keep this info in mind for the public facing sections of the webapp. @abuiles: Yes, I am using Ember Data — here are the versions I am using:
So, my /sessions/current payload looks like:
I'm guessing that since the JSON is not nested under "user", that this is causing it to fail? Not sure the best way to fix this; I investigated to find out where to configure the /sessions/current route to modify it to try to nest under user, but all I could find in my project related to this was this code in routes.rb:
What do you recommend as the best way to set up the /sessions/current rails response to format the data as expected? And one last question: in addition to attempting to nest the /sessions/current rails response under "user", what do I need to have set up on the Ember side for User? I assume a model at bare minimum, but do I also need a controller/route set up for this on the Ember side for this to work as well? (When I look in the Ember inspector, the User model I created is not getting populated with data). Thanks again for all of the help, and the work developing this project; It is great, and definitely the most elegant solution for getting Ember and Devise to play nicely :) Cheers, Jason |
Are you using activemodelserializers for your data? If so, you can just create a user_serializer and it should be correct. Let me know if that doesn't help. -- On March 22, 2014 at 2:39:46 PM, Jason Martin (notifications@github.com) wrote: to |
Thanks @joefiorini, yes I am using ActiveModelSerializers. Tried your suggestion and it appears to be working now! I was successfully able to set up a serializer for User, and now it returns the object as expected:
Now after logging in, it redirects me properly and the data is available in the User model when I check with Ember's Data inspector in Chrome. Thanks for the help, I really appreciate it! I'll follow up if I run into any more issues. All the best, Jason |
Had the exact same problem, although I had no idea it was anything to do with |
The old version as of (March 11th/13th) works fine for me, but when upgrading to the newest version that deserializes the /sessions/current user information into ember data, it breaks the front-end functionality for me. The old version uses: currentSession, the new version uses: currentUser.
I am using ember-rails.
After some testing, I discovered the problem seems to be the new javascript code. The GEM upgrade still lets me access the /sessions/current information via rails (and still works when I leave the old index.js version in place), but when I try to replace the index.js file with the new version, it constantly redirects me to sign-in no matter what I do.
I tried both with and without a user model created in Ember.
Any help would be appreciated!
All the best,
Jason
The text was updated successfully, but these errors were encountered: