Coder Social home page Coder Social logo

Comments (6)

monfresh avatar monfresh commented on August 18, 2024 4

@mesbahmilad This can be solved by overriding the Devise RegistrationsController in your app (or any other controller where you want to enforce 2FA), and adding a before_action, such as:

before_action :confirm_two_factor_authenticated, except: [:new, :create, :cancel]

def confirm_two_factor_authenticated
  return if is_fully_authenticated?

  flash[:error] = t('devise.errors.messages.user_not_authenticated')
  redirect_to user_two_factor_authentication_url
end

from two_factor_authentication.

wrgoto avatar wrgoto commented on August 18, 2024 2

This is a pretty huge security flaw. You can sign in without 2FA, go to the edit page and disable 2FA from there. I'd recommend adding a note in the README at least.

from two_factor_authentication.

Tectract avatar Tectract commented on August 18, 2024 1

This note should definitely be added to the readme, as a post-setup installation note. Can the gem be secured internally, though?

from two_factor_authentication.

Houdini avatar Houdini commented on August 18, 2024

Thanks for your report, could you please provide some example?

from two_factor_authentication.

mesbahmilad avatar mesbahmilad commented on August 18, 2024

Example:

If the devise model is "user", once logged in you are presented with the two-factor authentication wall to enter the code. From here you can navigate to "users/edit" and since this is a devise controller the gem skips code validation.

Once in the edit view you can edit the user information without being authorized with the code.

Ps. Great gem!

from two_factor_authentication.

Tectract avatar Tectract commented on August 18, 2024

I made a PR, here:

#160

I'm not sure why it failed travis-CI, I only updated the readme...

from two_factor_authentication.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.