Sha256: b3a616b01bd7799d2e14a8a947c1753267c9269358ff18e9a099f0922cbc0170
Contents?: true
Size: 1.13 KB
Versions: 12
Compression:
Stored size: 1.13 KB
Contents
# frozen_string_literal: true 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(: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
12 entries across 12 versions & 1 rubygems