Class: ConfirmationsController
- Inherits:
-
Devise::ConfirmationsController
- Object
- Devise::ConfirmationsController
- ConfirmationsController
- Includes:
- AcceptsPendingInvitations, GitlabRecaptcha, OneTrustCSP
- Defined in:
- app/controllers/confirmations_controller.rb
Instance Method Summary collapse
- #almost_there ⇒ Object
-
#show ⇒ Object
modified from Devise::ConfirmationsController github.com/heartcombo/devise/blob/e9c534d363cc9d552662049b38582eead87bedd6/app/controllers/devise/confirmations_controller.rb#L22 since we must accept a user_id sharding param and use it in the lookup for Email confirmations, but User confirmations should remain unchanged.
Methods included from GitlabRecaptcha
Methods included from RecaptchaHelper
#recaptcha_enabled?, #recaptcha_enabled_on_login?
Methods included from AcceptsPendingInvitations
#accept_pending_invitations, #after_pending_invitations_hook
Instance Method Details
#almost_there ⇒ Object
13 14 15 16 |
# File 'app/controllers/confirmations_controller.rb', line 13 def almost_there flash[:notice] = nil render layout: "devise_empty" end |
#show ⇒ Object
modified from Devise::ConfirmationsController github.com/heartcombo/devise/blob/e9c534d363cc9d552662049b38582eead87bedd6/app/controllers/devise/confirmations_controller.rb#L22 since we must accept a user_id sharding param and use it in the lookup for Email confirmations, but User confirmations should remain unchanged
this override can be removed once emails table is re-sharded to organization_id and we’ve refactored to override Email.confirm_by_token instead gitlab.com/gitlab-org/gitlab/-/work_items/585903
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/confirmations_controller.rb', line 26 def show return super unless resource_class == Email && email_confirmation_params[:user_id].present? self.resource = confirm_email_by_token( email_confirmation_params[:user_id], email_confirmation_params[:confirmation_token] ) if resource.errors.empty? (:notice, :confirmed) (resource) { redirect_to after_confirmation_path_for(resource_name, resource) } else (resource.errors, status: :unprocessable_entity) { render :new } end end |