admin login now honors seed file

This commit is contained in:
Priit Tamboom 2014-11-25 15:28:32 +02:00
parent 0ccc70fcf4
commit 0ef51a12c4
2 changed files with 10 additions and 4 deletions

View file

@ -3,7 +3,10 @@ class SessionsController < Devise::SessionsController
# TODO: Create ID Card login here:
# this is just testing config
# if Rails.env.development? || Rails.env.test?
@user = User.find_by(username: 'gitlab') if params[:gitlab]
@user = User.first if params[:user1]
@user = User.second if params[:user2]
return redirect_to :back, alert: 'No user' if @user.blank?
session[:current_user_registrar_id] = Registrar.first.id if @user.admin?