Skip to content

Commit

Permalink
Merge pull request #667 from slovensko-digital/fix/do_not_offer_eid_l…
Browse files Browse the repository at this point in the history
…ogin_unless_env_set

Do not offer EID login unless env set
  • Loading branch information
luciajanikova authored Apr 30, 2024
2 parents 672fa5d + c2b2b20 commit b60c671
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 4 additions & 2 deletions app/views/eid/onboarding/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
<%= image_submit_tag 'google/btn_google_signin_dark_normal.svg', class: 'govuk-link', title: 'Prihlásiť sa cez Google', alt: 'Prihlásiť sa cez Google', style: 'max-width: 300px' %>
<% end %>

<%= form_tag(auth_path(:eid), method: :post, class: 'govuk-body govuk-!-margin-bottom-8') do %>
<%= image_submit_tag 'eid-sk.svg', class: 'govuk-link', title: 'Prihlásiť sa cez eID', alt: 'Prihlásiť sa cez eID', style: 'max-width: 300px' %>
<% if ENV['AUTH_EID_BASE_URL'].present? %>
<%= form_tag(auth_path(:eid), method: :post, class: 'govuk-body govuk-!-margin-bottom-8') do %>
<%= image_submit_tag 'eid-sk.svg', class: 'govuk-link', title: 'Prihlásiť sa cez eID', alt: 'Prihlásiť sa cez eID', style: 'max-width: 300px' %>
<% end %>
<% end %>

<%= form_tag(auth_path(:magiclink), method: :post, id: 'login-email') do %>
Expand Down
6 changes: 4 additions & 2 deletions app/views/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
<%= image_submit_tag 'google/btn_google_signin_dark_normal.svg', class: 'govuk-link', title: 'Prihlásiť sa cez Google', alt: 'Prihlásiť sa cez Google', style: 'max-width: 300px' %>
<% end %>

<%= form_tag(auth_path(:eid), method: :post, class: 'govuk-body govuk-!-margin-bottom-8') do %>
<%= image_submit_tag 'eid-sk.svg', class: 'govuk-link', title: 'Prihlásiť sa cez slovensko.sk', alt: 'Prihlásiť sa cez slovensko.sk', style: 'max-width: 300px' %>
<% if ENV['AUTH_EID_BASE_URL'].present? %>
<%= form_tag(auth_path(:eid), method: :post, class: 'govuk-body govuk-!-margin-bottom-8') do %>
<%= image_submit_tag 'eid-sk.svg', class: 'govuk-link', title: 'Prihlásiť sa cez slovensko.sk', alt: 'Prihlásiť sa cez slovensko.sk', style: 'max-width: 300px' %>
<% end %>
<% end %>

<%= form_tag(auth_path(:magiclink), method: :post, id: 'login-email') do %>
Expand Down
7 changes: 5 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,11 @@
get '/auth/failure', to: 'sessions#failure'
get '/auth/:provider/callback', to: 'sessions#create', as: :auth_callback
post '/auth/:provider', to: lambda { |_| [404, {}, ["Not Found"]] }, as: :auth
get '/login', to: 'sessions#create', as: :login
get '/logout', to: 'sessions#destroy', as: :logout

if ENV['AUTH_EID_BASE_URL'].present?
get '/login', to: 'sessions#create', as: :login
get '/logout', to: 'sessions#destroy', as: :logout
end

resources :faqs, path: 'casto-kladene-otazky'
resources :pages, path: '', only: 'show'
Expand Down

0 comments on commit b60c671

Please sign in to comment.