Class: Decidim::IdcatMobil::VerificationJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/decidim/idcat_mobil/verification_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(oauth_data) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/jobs/decidim/idcat_mobil/verification_job.rb', line 8

def perform(oauth_data)
  handler = retrieve_handler(oauth_data)
  Decidim::Verifications::AuthorizeUser.call(handler) do
    on(:ok) do
      notify_user(handler.user, :ok, handler)
    end

    on(:invalid) do
      notify_user(handler.user, :invalid, handler)
    end
  end
end