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 Devise.authentication_keys method name #26

Closed
wants to merge 1 commit into from

Conversation

r3cha
Copy link

@r3cha r3cha commented Apr 19, 2019

If you have in your Devise configuration changed authentication_keys like:

 config.authentication_keys = [:phone]

In project was hardcoded generation method guest_email_authentication_key
But we need to be dynamic from config.authentication_keys
In this fix takes only first element of array

@@ -71,7 +71,7 @@ def create_guest_#{mapping} key = nil
end
end

def guest_email_authentication_key key
def guest_#{class_name.constantize.authentication_keys.first}_authentication_key key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right. With the suggested change you would just be populating your phone attribute with a guest email address.

A better solution might be to update the README with instructions for adding your own guest_phone_authentication_key method which will return the right guest-mocked content?

@pacso
Copy link
Collaborator

pacso commented Oct 25, 2021

Will resolve with #36

@pacso pacso closed this Oct 25, 2021
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.

2 participants