Sha256: 376454fd26863e0f39e0188b88bcb5e5ed78463ca46b9aab792474bc9194967e

Contents?: true

Size: 460 Bytes

Versions: 2

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module DirectVerifications
    module Verification
      class ConfirmUserAuthorization < Decidim::Verifications::ConfirmUserAuthorization
        def call
          return broadcast(:invalid) unless form.valid?

          if confirmation_successful?
            authorization.grant!
            broadcast(:ok)
          else
            broadcast(:invalid)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
decidim-direct_verifications-0.2.2 app/commands/decidim/direct_verifications/verification/confirm_user_authorization.rb
decidim-direct_verifications-0.2.1 app/commands/decidim/direct_verifications/verification/confirm_user_authorization.rb