Replies: 2 comments 6 replies
-
I think the best fix would be not allowing email auth for accounts with omniauth connected providers: # in omniauth feature
def allow_email_auth?
(defined?(super) ? super : true) && omniauth_connected_providers.empty?
end This works because |
Beta Was this translation helpful? Give feedback.
-
I think I noticed one more place where
This is because |
Beta Was this translation helpful? Give feedback.
-
I'm close to releasing an OmniAuth integration for Rodauth. When the user logs in via an OmniAuth strategy, the session is considered authenticated by
"omniauth"
. Additionally,"omniauth"
is added topossible_authentication_methods
if there is at least one connected provider. I mimicked the implementation from the email auth feature:However, I quickly realized that this doesn't work well when both email auth and two factor base features are enabled, because as soon as the user connects an external provider,
possible_authentication_methods
returns["email_auth", "omniauth"]
, which causesuses_two_factor_authentication?
to returntrue
. In the Rails demo app, I have the following code in the Roda's route block, which then triggers a request for multifactor authentication:How do I correctly deal with this scenario? If I also check that
!methods.include?("email_auth")
, that will work only when omniauth feature is enabled after email auth, but not the other way around.Beta Was this translation helpful? Give feedback.
All reactions