From 1734b8bfd647cd7d0bb729e1519248def78287ce Mon Sep 17 00:00:00 2001 From: Joerg Reichert Date: Sat, 26 Mar 2016 10:00:04 +0100 Subject: [PATCH] Login button entfernt --- app/assets/javascripts/application.js | 15 ------------ app/views/application/_login_button.html.slim | 9 ------- app/views/layouts/application.html.slim | 3 --- test/integration/authentication_test.rb | 24 ------------------- 4 files changed, 51 deletions(-) delete mode 100644 app/views/application/_login_button.html.slim delete mode 100644 test/integration/authentication_test.rb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index c66d63d..02c7405 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -17,18 +17,3 @@ //= require_tree . $(function(){ $(document).foundation(); }); - -$('[data-persona-login]').click(function(e) { - e.preventDefault(); - navigator.id.get(function(assertion) { - if (assertion) { - if (assertion) { - var form = $('#browser-id-form'); - form.find('input[name=assertion]').val(assertion); - form.submit(); - } else { - // TODO: Handle failure - } - } - }); -}); diff --git a/app/views/application/_login_button.html.slim b/app/views/application/_login_button.html.slim deleted file mode 100644 index d7e8879..0000000 --- a/app/views/application/_login_button.html.slim +++ /dev/null @@ -1,9 +0,0 @@ -= form_tag '/auth/browser_id/callback', id: 'browser-id-form' - = hidden_field_tag(:assertion) - -- if signed_in? - = link_to session_path, data: { method: :delete, logout: true } - | Abmelden -- else - = link_to session_path, data: { 'persona-login' => true } - | Anmelden diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index 6526e49..9d19b35 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -11,11 +11,8 @@ html .row .small-12.columns .clearfix - .right = render 'login_button' h1#title = link_to 'Stadtratmonitor Leipzig', root_path - flash.each do |name, msg| = content_tag :div, msg, class: name = yield - script src="https://login.persona.org/include.js" - = javascript_include_tag 'application', 'data-turbolinks-track' => true diff --git a/test/integration/authentication_test.rb b/test/integration/authentication_test.rb deleted file mode 100644 index e208374..0000000 --- a/test/integration/authentication_test.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'test_helper' - -class AuthenticationTest < ActionDispatch::IntegrationTest - test 'register via first time sign in and sign out' do - visit '/auth/developer' - fill_in 'Name', with: 'me' - fill_in 'Email', with: 'user@example.com' - click_button 'Sign In' - assert_equal '/leipzig', current_path - assert_is_signed_in - - click_link 'Abmelden' - assert_equal '/leipzig', current_path - assert_is_signed_out - end - - def assert_is_signed_in - assert_equal 'Abmelden', find('[data-logout]').text - end - - def assert_is_signed_out - assert_equal 'Anmelden', find('[data-persona-login]').text - end -end