Sha256: 3c4765924b5bbf897717c47c87781faa1c58cdce11d2d802a437566ece19c9ec

Contents?: true

Size: 1.1 KB

Versions: 55

Compression:

Stored size: 1.1 KB

Contents

module ThinkFeelDoEngine
  module Participants
    # Customize Participant password actions.
    class PasswordsController < Devise::PasswordsController
      # PUT /resource/password
      def update
        participant = Participant
                      .with_reset_password_token(
                        params[:participant][:reset_password_token]
                      )
        if participant && !participant.active_membership
          msg = "We're sorry, but you can't sign in yet because you are not " \
                "assigned to an active group."
          redirect_to new_participant_session_path, alert: msg
        else
          super do |resource|
            ParticipantLoginEvent.create(participant_id: resource.id)
          end
        end
      end

      def create
        @participant = Participant.find_by(email: resource_params[:email])
        if @participant.try(:is_not_allowed_in_site)
          msg = "New password cannot be sent; this account is not active."
          redirect_to new_participant_session_path, alert: msg
        else
          super
        end
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
think_feel_do_engine-3.19.9 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.19.8 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.19.7 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.19.6 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.19.5 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.19.4 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.19.3 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.19.2 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.19.1 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.19.0 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.18.0 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.17.2 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.17.1 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.17.0 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.16.3 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.16.2 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.16.1 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.15.7 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.16.0 app/controllers/think_feel_do_engine/participants/passwords_controller.rb
think_feel_do_engine-3.15.6 app/controllers/think_feel_do_engine/participants/passwords_controller.rb