debian-mirror-gitlab/lib/gitlab/auth/otp/strategies/devise.rb
2021-01-03 14:25:43 +05:30

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