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 class SessionsController < Devise::SessionsController
def create def create
if Rails.env.development? || Rails.env.test? #TODO: Create ID Card login here:
@user = User.find_by(username: 'gitlab') if params[:gitlab] # this is just testing config
@user = User.find_by(username: 'zone') if params[:zone] # 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') flash[:notice] = I18n.t('shared.welcome')
sign_in_and_redirect @user, :event => :authentication sign_in_and_redirect @user, :event => :authentication
return return
end # end
end end
def login def login

View file

@ -20,9 +20,6 @@
.alert{class: type}= flash[:notice] || flash[:alert] .alert{class: type}= flash[:notice] || flash[:alert]
%h2.form-signin-heading.text-center Eesti Interneti SA %h2.form-signin-heading.text-center Eesti Interneti SA
%hr %hr
- if Rails.env.development? || Rails.env.test? / 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 (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' = 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'