You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently devise-passwordless has a hard-coded assumption that email is the only authentication key. However, devise allows using other attributes for retrieving and authenticating the user
class CustomUser < ApplicationRecord
devise :magic_link_authenticatable, :authentication_keys => [:username]
end
I have a use case where I have a user model with an email attribute but where the email address is present but is not a unique key. Instead a separate unique username is used to retrieve the user and send them a login link.
It would be nice if devise-passwordless would respect the authentication_keys config setting and use these attributes to build the magic link and for the permitted params in the Devise::Passwordless::SessionsController.
I am happy to submit a PR with this change, but wanted to check first if you are interested in incorporating this change.
The text was updated successfully, but these errors were encountered:
On Tue, Jul 23, 2024 at 2:32 AM Simon Stemplinger ***@***.***> wrote:
Currently devise-passwordless has a hard-coded assumption that email is
the only authentication key. However, devise allows using other attributes
for retrieving and authenticating the user
class CustomUser < ApplicationRecord
devise :magic_link_authenticatable, :authentication_keys => [:username]
end
I have a use case where I have a user model with an email attribute but
where the email address is present but is not a unique key. Instead a
separate unique username is used to retrieve the user and send them a
login link.
Other tools like active_admin use these authentication_keys to dynamically
build the login form
<https://github.com/activeadmin/activeadmin/blob/master/app/views/active_admin/devise/sessions/new.html.erb#L9>
.
It would be nice if devise-passwordless would respect the
authentication_keys config setting and use these attributes to build the
magic link and for the permitted params in the
Devise::Passwordless::SessionsController.
I am happy to submit a PR with this change, but wanted to check first if
you are interested in incorporating this change.
—
Reply to this email directly, view it on GitHub
<#65>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFO43FFEBTQXFDRYWIYODZNYBITAVCNFSM6AAAAABLJ2ICHCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQZDINBXHE3DAOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Currently
devise-passwordless
has a hard-coded assumption thatemail
is the only authentication key. However, devise allows using other attributes for retrieving and authenticating the userI have a use case where I have a user model with an
email
attribute but where the email address is present but is not a unique key. Instead a separate uniqueusername
is used to retrieve the user and send them a login link.Other tools like
active_admin
use theseauthentication_keys
to dynamically build the login form.It would be nice if
devise-passwordless
would respect theauthentication_keys
config setting and use these attributes to build the magic link and for the permitted params in theDevise::Passwordless::SessionsController
.I am happy to submit a PR with this change, but wanted to check first if you are interested in incorporating this change.
The text was updated successfully, but these errors were encountered: