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

Set warden user before authenticating #53

Closed
wants to merge 1 commit into from
Closed

Set warden user before authenticating #53

wants to merge 1 commit into from

Conversation

bigchickenwings
Copy link

What?

Set the warden user with warden.set_user(@user) before attempting to run warden.authenticate!(auth_options).

Why?

When trying to set up devise-passwordless on my app, I couldn't log in after clicking the login link.

After further investigation, I noticed that the problem was that the auth_options for my app didn't contain any information related to the user, other than the :scope => :user.

Are there any side effects or bugs people should be aware of?

No. If warden fails to set a user, this means that there is no user with the given email to begin with, and the warden user would just be nil.

The show action would then proceed to attempt to authenticate just as always.

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.

1 participant