You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: backup_codes.rb
    path of file: ./repos/openproject/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication
    
    the code of the file until where you have to start completion: module ::TwoFactorAuthentication
  module BackupCodes
    extend ActiveSupport::Concern

    ##
    # Request user to enter backup code
    def enter_backup_code
      render
    end

    ##
    # Verify backup code
    def verify_backup_code
      code = params[:backup_code]
      return fa
    
    def verify_backup_code
      code = params[:backup_code]
      return fail_login(t('two_factor_authentication.error_invalid_backup_code')) unless code.present?

      service = TwoFactorAuthentication::UseBackupCodeService.new user: @authenticated_user
      result = service.verify code
      if result.success?
        complete_stage_redirect
      else
        fail_login(t('two_factor_authentication.error_invalid_backup_code'))
      end