Class: Auth::ConfirmationsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/auth/confirmations_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#devise_mapping

Instance Method Details

#showObject

GET /resource/confirmation?confirmation_token=abcdef



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/auth/confirmations_controller.rb', line 10

def show
  self.resource = resource_class.confirm_by_token(params[:confirmation_token])

  if resource&.errors&.empty?
    set_flash_message(:notice, :confirmed) if is_navigational_format?
    # sign_in(resource_name, resource)
    respond_with_navigational(resource) do
      redirect_to after_confirmation_path_for(resource_name, resource)
    end
  else
    respond_with_navigational(resource ? resource.errors : nil, status: :unprocessable_entity) do
      render :failure
    end
  end
end