FarmBot/Farmbot-Web-App

View on GitHub
app/mutations/auth/consent_helpers.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Auth
  module ConsentHelpers
    def maybe_validate_tos
      return unless User::ENFORCE_TOS # Not every server has a TOS.
      no_tos! unless agree_to_terms
    end

    def no_tos!
      add_error :terms_of_service, :consent, "you must agree to the terms of use."
    end
  end
end