Class: Decidim::Verifications::AuthorizationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Decidim::Verifications::AuthorizationsController
- Includes:
- UserProfile, Renewable
- Defined in:
- app/controllers/decidim/verifications/authorizations_controller.rb
Overview
This controller allows users to create and destroy their authorizations. It shouldn’t be necessary to expand it to add new authorization schemes.
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/decidim/verifications/authorizations_controller.rb', line 37 def create AuthorizeUser.call(handler) do on(:ok) do flash[:notice] = t("authorizations.create.success", scope: "decidim.verifications") redirect_to redirect_url || end on(:invalid) do flash[:alert] = t("authorizations.create.error", scope: "decidim.verifications") render action: :new end end end |
#first_login ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/decidim/verifications/authorizations_controller.rb', line 27 def first_login if .length == 1 redirect_to( action: :new, handler: .first.name, redirect_url: decidim.account_path ) end end |
#index ⇒ Object
22 23 24 25 |
# File 'app/controllers/decidim/verifications/authorizations_controller.rb', line 22 def index @granted_authorizations = @pending_authorizations = end |
#new ⇒ Object
20 |
# File 'app/controllers/decidim/verifications/authorizations_controller.rb', line 20 def new; end |