forked from External/greenlight
		
	This reverts commit 404134aa8d.
			
			
This commit is contained in:
		@@ -29,19 +29,13 @@ class SessionsController < ApplicationController
 | 
				
			|||||||
  def create
 | 
					  def create
 | 
				
			||||||
    user = User.find_by(email: session_params[:email])
 | 
					    user = User.find_by(email: session_params[:email])
 | 
				
			||||||
    if user && !user.greenlight_account?
 | 
					    if user && !user.greenlight_account?
 | 
				
			||||||
      if request.referrer.present?
 | 
					 | 
				
			||||||
        redirect_to request.referrer, alert: I18n.t("invalid_login_method")
 | 
					 | 
				
			||||||
      else
 | 
					 | 
				
			||||||
      redirect_to root_path, alert: I18n.t("invalid_login_method")
 | 
					      redirect_to root_path, alert: I18n.t("invalid_login_method")
 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
    elsif user.try(:authenticate, session_params[:password])
 | 
					    elsif user.try(:authenticate, session_params[:password])
 | 
				
			||||||
      if user.email_verified
 | 
					      if user.email_verified
 | 
				
			||||||
        login(user)
 | 
					        login(user)
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        redirect_to(account_activation_path(email: user.email)) && return
 | 
					        redirect_to(account_activation_path(email: user.email)) && return
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    elsif request.referrer.present?
 | 
					 | 
				
			||||||
      redirect_to request.referrer, alert: I18n.t("invalid_credentials")
 | 
					 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      redirect_to root_path, alert: I18n.t("invalid_credentials")
 | 
					      redirect_to root_path, alert: I18n.t("invalid_credentials")
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,11 +32,7 @@ module SessionsHelper
 | 
				
			|||||||
  # If email verification is disabled, or the user has verified, go to their room
 | 
					  # If email verification is disabled, or the user has verified, go to their room
 | 
				
			||||||
  def check_email_verified(user)
 | 
					  def check_email_verified(user)
 | 
				
			||||||
    if !Rails.configuration.enable_email_verification || user.email_verified
 | 
					    if !Rails.configuration.enable_email_verification || user.email_verified
 | 
				
			||||||
      if request.referrer.present?
 | 
					 | 
				
			||||||
        redirect_to request.referrer
 | 
					 | 
				
			||||||
      else
 | 
					 | 
				
			||||||
      redirect_to user.main_room
 | 
					      redirect_to user.main_room
 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      redirect_to resend_path
 | 
					      redirect_to resend_path
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,8 +13,6 @@
 | 
				
			|||||||
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 | 
					# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
%>
 | 
					%>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<%= render 'shared/flash_messages' unless flash.empty? %>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<%= render 'shared/room_event' do %>
 | 
					<%= render 'shared/room_event' do %>
 | 
				
			||||||
  <%= form_for room_path(@room), method: :post do |f| %>
 | 
					  <%= form_for room_path(@room), method: :post do |f| %>
 | 
				
			||||||
    <div class="input-group join-input">
 | 
					    <div class="input-group join-input">
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user