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