mirror of
https://github.com/internetee/registry.git
synced 2025-07-13 22:45:06 +02:00
Test login to production env too
This commit is contained in:
parent
7963330aeb
commit
f837500e7a
2 changed files with 12 additions and 13 deletions
|
@ -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
|
||||||
|
|
|
@ -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'
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue