Skip to content
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

Fix encrypt_cookie and sign_cookie when controller is nil #725

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

peterzhu2118
Copy link
Contributor

If you enable eager loading or try to use the UserSession model before the first request, Authlogic::Session::Base.controller is not initialized so if you set sign_cookie or encrypt_cookie, it will crash.

@tiegz
Copy link
Collaborator

tiegz commented Jul 10, 2020

Makes sense to me, how about you @jaredbeck ?

@jaredbeck
Copy link
Collaborator

jaredbeck commented Jul 11, 2020

It seems fine to merge as is, but (bikeshedding) I think the error message could be better. I think the current message will be "Signed cookies not supported with NilClass". A better message would be "Authlogic has not been activated yet, so the sign_cookie option cannot be set", or something like that.

Edit: On second thought, my suggestion re: error message doesn't make sense, and I've merged this as is.

@jaredbeck jaredbeck merged commit f8f64cf into binarylogic:master Sep 10, 2020
jaredbeck added a commit that referenced this pull request Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants