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

Session: validate authenticatable presence explicitly #32

Merged
merged 1 commit into from Jan 7, 2019

Conversation

EugZol
Copy link
Contributor

@EugZol EugZol commented Nov 26, 2018

It is required when config.load_defaults 5.2 is absent from application.rb. Otherwise, when entering email for non-existent user this code from session_controller.rb works incorrectly:

def create
  session = build_passwordless_session(find_authenticatable)

  if session.save
    Mailer.magic_link(session).deliver_now
  end

  render
end

save actually returns true and Mailer.magic_link(nil) is called.

@mikker
Copy link
Owner

mikker commented Nov 26, 2018

Thank you for finding and reporting this! Should we add a test for It? With that I’ll be happy to merge.

@mikker mikker merged commit 90d05bf into mikker:master Jan 7, 2019
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.

None yet

2 participants