sorcery: User not being placed in the session after Rails 4.2-5.2 upgrade
Configuration
- Sorcery Version:
0.13.0
- Ruby Version:
2.3.5
- Framework:
Rails 5.2
- Platform:
Mac
Expected Behavior
When I call #login
in my controller it should place the user id in the session.
Actual Behavior
When I call #login
in my controller, it returns the user as it should. It doesn’t place the user in the session though so it isn’t actually logged in. I have a feeling it is some configuration that should be changed due to my Rails 4.2->5.2 and Sorcery 0.9.1->0.13.0 upgrades which caused this, I just don’t know what it is.
Steps to Reproduce
I’m not sure how to reproduce it in any app other than my specific situation.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (10 by maintainers)
Thanks for making sure I knew that, as it seems there are lots of people who don’t think about things like that! When I built the app I went the extra 100 miles and actually encrypted the db column data using attr_encrypted (some other columns too like email). So bcrypt is in place and than attr_encrypted on top of that…safest app on the web! 😄
Okay…I figured it out. I have a custom
Account.authenticate
method. The question is, why does 0.10.3 work?! I think I followed a tutorial 5 years ago when I built the app which showed how to encrypt the user’s email and password in the db data which is why theauthenticate
method is needed. I think I am actually going to remove the encryption anyway so I will be able to upgrade after that. Thank you so much for helping me figure this out! By the way, When the model method didn’t get called I ranshow-source Account.authenticate
in pry and lo and behold…I had my override method.Thanks again!