gitlab-org--gitlab-foss/lib/gitlab/auth/otp/strategies/devise.rb

15 lines
304 B
Ruby

# 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