Test login to production env too

This commit is contained in:
Martin Lensment 2014-09-26 14:30:55 +03:00
parent 7963330aeb
commit f837500e7a
2 changed files with 12 additions and 13 deletions

View file

@ -1,13 +1,15 @@
class SessionsController < Devise::SessionsController
def create
if Rails.env.development? || Rails.env.test?
@user = User.find_by(username: 'gitlab') if params[:gitlab]
@user = User.find_by(username: 'zone') if params[:zone]
#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.find_by(username: 'zone') if params[:zone]
flash[:notice] = I18n.t('shared.welcome')
sign_in_and_redirect @user, :event => :authentication
return
end
flash[:notice] = I18n.t('shared.welcome')
sign_in_and_redirect @user, :event => :authentication
return
# end
end
def login

View file

@ -20,9 +20,6 @@
.alert{class: type}= flash[:notice] || flash[:alert]
%h2.form-signin-heading.text-center Eesti Interneti SA
%hr
- if Rails.env.development? || Rails.env.test?
= button_to 'ID card (gitlab)', 'sessions', class: 'btn btn-lg btn-primary btn-block', name: 'gitlab'
= button_to 'ID card (zone)', 'sessions', class: 'btn btn-lg btn-primary btn-block', name: 'zone'
-else
= button_to 'ID card', 'sessions', class: 'btn btn-lg btn-primary btn-block'
= button_to 'Mobile ID', 'sessions', class: 'btn btn-lg btn-primary btn-block'
/ TODO: Refactor this when ID card login is done
= button_to 'ID card (gitlab)', 'sessions', class: 'btn btn-lg btn-primary btn-block', name: 'gitlab'
= button_to 'ID card (zone)', 'sessions', class: 'btn btn-lg btn-primary btn-block', name: 'zone'