summaryrefslogtreecommitdiff
path: root/lib/gitlab/auth/otp/strategies/devise.rb
blob: 93068d6c9b0861c53f72ef4c6b88cd1b79a7364f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

module Gitlab
  module Auth
    module Otp
      module Strategies
        class Devise < Base
          def validate(otp_code)
            user.validate_and_consume_otp!(otp_code) ? success : error('invalid OTP code')
          end
        end
      end
    end
  end
end