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
Firstly thanks for this gem, it has, for the most part, been excellent to use.
Issue
calling the helper is_fully_authenticated? when the resource is not called user, always returns true.
Background
We have been refactoring a few of our authentication processes, and I have discovered that is_fully_authenticated? will return true if your user model is not called user.
Example
One of our user models is called admin. In one our our exposed devise controllers, we are calling the following to ensure two_factor is required:
Firstly thanks for this gem, it has, for the most part, been excellent to use.
Issue
calling the helper
is_fully_authenticated?
when the resource is not calleduser
, always returns true.Background
We have been refactoring a few of our authentication processes, and I have discovered that
is_fully_authenticated?
will return true if your user model is not called user.Example
One of our user models is called
admin
. In one our our exposed devise controllers, we are calling the following to ensure two_factor is required:The session is now:
But now,
is_fully_authenticated?
returns true because it runs this check:It should be returning false. Note the
warden.user.user
instead of thewarden.user.admin
Proposed fix
The helper should be:
In theory, this could be achieved with
If I am correct please let me know and I will attempt to make a pr for you. Otherwise any suggestions to my implementation are welcome.
The text was updated successfully, but these errors were encountered: