Sha256: abd60504b4f5a49ccc2be505747a6f81d214fb8f0c047401d91a769474bfeadd

Contents?: true

Size: 748 Bytes

Versions: 46

Compression:

Stored size: 748 Bytes

Contents

module Incline
  class AccountActivationsController < ApplicationController

    require_anon true

    ##
    # GET /incline/activate/activation-token?email=user@example.com
    def edit
      if logged_in?
        flash[:danger] = 'You cannot reactivate your account.'
        redirect_to main_app.root_url
      else
        user = User.find_by(email: params[:email].downcase)
        if user && !user.activated? && user.authenticated?(:activation, params[:id])
          user.activate
          log_in user
          flash[:success] = 'Your account has been activated.'
          redirect_to user
        else
          flash[:danger] = 'Invalid activation link'
          redirect_to main_app.root_url
        end
      end
    end

  end

end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
incline-0.3.14 app/controllers/incline/account_activations_controller.rb
incline-0.3.13 app/controllers/incline/account_activations_controller.rb
incline-0.3.12 app/controllers/incline/account_activations_controller.rb
incline-0.3.11 app/controllers/incline/account_activations_controller.rb
incline-0.3.10 app/controllers/incline/account_activations_controller.rb
incline-0.3.9 app/controllers/incline/account_activations_controller.rb
incline-0.3.8 app/controllers/incline/account_activations_controller.rb
incline-0.3.7 app/controllers/incline/account_activations_controller.rb
incline-0.3.6 app/controllers/incline/account_activations_controller.rb
incline-0.3.5 app/controllers/incline/account_activations_controller.rb
incline-0.3.4 app/controllers/incline/account_activations_controller.rb
incline-0.3.3 app/controllers/incline/account_activations_controller.rb
incline-0.3.2 app/controllers/incline/account_activations_controller.rb
incline-0.3.1 app/controllers/incline/account_activations_controller.rb
incline-0.3.0 app/controllers/incline/account_activations_controller.rb
incline-0.2.36 app/controllers/incline/account_activations_controller.rb
incline-0.2.35 app/controllers/incline/account_activations_controller.rb
incline-0.2.34 app/controllers/incline/account_activations_controller.rb
incline-0.2.28 app/controllers/incline/account_activations_controller.rb
incline-0.2.27 app/controllers/incline/account_activations_controller.rb