Issues when combining login with password and passwordless in the same model. #60
Unanswered
JoseMariaSierra
asked this question in
Q&A
Replies: 2 comments 1 reply
-
To fix it, what I did was remove the 'active_for_magic_link_authentication?' method and add the use of passwordless to my model conditionally: devise :magic_link_authenticatable if -> { magic_link_enabled? } This way it works correctly. |
Beta Was this translation helpful? Give feedback.
0 replies
-
👋 Hey, sorry I didn't get to this before you figured out a solution. As time allows I will try to add your setup to our testing harness and figure out what went wrong. Thanks for coming back to share your solution! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I apologize in advance if I'm not understanding the gem's functionality correctly, but I'm encountering issues when using both the native login system of Devise and the passwordless one in the same model.
In my user model, I have the following setup
That means, I've implemented logic similar to Disabling password authentication or magic link authentication.
magic_link
andpassword_auth
are two boolean columns used to determine whether a user utilizes one or the other authorization system. For testing purposes, they're set as follows:magic_link: false
,password_auth: true
.With this setup, a user can never log in with a password unless the
active_for_magic_link_authentication?
method returns true. In other words, for some reason, I'm forced to set themagic_link
column to true to allow a user to log in with a password.Oddly, the execution always goes through active_for_magic_link_authentication? even if I remove magic_link_authenticatable, and the login is performed with a password.
The only way for a user to use a password, given the gem, is as follows (Or removing the method):
It's worth noting that I haven't added any additional logic beyond the routes indicated in the documentation.
Could you assist me with this? Is this the expected behavior of the gem?
I thought I could use both systems simultaneously, but I'm not achieving it.
Thank you very much
Beta Was this translation helpful? Give feedback.
All reactions