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

Do we have any two_factor_method like authenticate_user! #58

Closed
ashvushinde opened this issue Nov 30, 2015 · 3 comments
Closed

Do we have any two_factor_method like authenticate_user! #58

ashvushinde opened this issue Nov 30, 2015 · 3 comments

Comments

@ashvushinde
Copy link

I need to to authenticate a user is two-step authenticated or not.
As in simple devise we had a method like
authenticate_user!

I need to set this in before_action filter.
Can we have similar method for two-factor-authentication?

@ashvushinde ashvushinde changed the title Do we have any two_factor_method like authenticate-user! Do we have any two_factor_method like authenticate_user! Nov 30, 2015
@Houdini
Copy link
Owner

Houdini commented Dec 1, 2015

You can use

def need_two_factor_authentication?(request)
  request.ip != '127.0.0.1'
end

in user model. Is this what you need?

@ashvushinde
Copy link
Author

Not this actually.

- if user_signed_in?  
  #Some HTML part

So the issue is i need a method which will be equivalent like this. Because it still shows the header and sidebar while we are inserting the OTP to the HTML view.
Ideally while entering the OTP, the header and sidebar should not displayed because user has not completely signed in.
Am i missing something here ?

@Houdini
Copy link
Owner

Houdini commented Dec 2, 2015

Ough, yes.
Please check method

is_fully_authenticated?

it's exactly controller helper.

@Houdini Houdini closed this as completed Dec 13, 2015
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

No branches or pull requests

2 participants