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.2.26 app/controllers/incline/account_activations_controller.rb
incline-0.2.25 app/controllers/incline/account_activations_controller.rb
incline-0.2.24 app/controllers/incline/account_activations_controller.rb
incline-0.2.23 app/controllers/incline/account_activations_controller.rb
incline-0.2.22 app/controllers/incline/account_activations_controller.rb
incline-0.2.21 app/controllers/incline/account_activations_controller.rb
incline-0.2.20 app/controllers/incline/account_activations_controller.rb
incline-0.2.19 app/controllers/incline/account_activations_controller.rb
incline-0.2.18 app/controllers/incline/account_activations_controller.rb
incline-0.2.17 app/controllers/incline/account_activations_controller.rb
incline-0.2.16 app/controllers/incline/account_activations_controller.rb
incline-0.2.15 app/controllers/incline/account_activations_controller.rb
incline-0.2.14 app/controllers/incline/account_activations_controller.rb
incline-0.2.13 app/controllers/incline/account_activations_controller.rb
incline-0.2.12 app/controllers/incline/account_activations_controller.rb
incline-0.2.11 app/controllers/incline/account_activations_controller.rb
incline-0.2.10 app/controllers/incline/account_activations_controller.rb
incline-0.2.9 app/controllers/incline/account_activations_controller.rb
incline-0.2.8 app/controllers/incline/account_activations_controller.rb
incline-0.2.7 app/controllers/incline/account_activations_controller.rb