Login button entfernt

This commit is contained in:
Joerg Reichert 2016-03-26 10:00:04 +01:00
parent 8974da062c
commit 1734b8bfd6
4 changed files with 0 additions and 51 deletions

View file

@ -17,18 +17,3 @@
//= require_tree . //= require_tree .
$(function(){ $(document).foundation(); }); $(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
}
}
});
});

View file

@ -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

View file

@ -11,11 +11,8 @@ html
.row .row
.small-12.columns .small-12.columns
.clearfix .clearfix
.right = render 'login_button'
h1#title = link_to 'Stadtratmonitor Leipzig', root_path h1#title = link_to 'Stadtratmonitor Leipzig', root_path
- flash.each do |name, msg| - flash.each do |name, msg|
= content_tag :div, msg, class: name = content_tag :div, msg, class: name
= yield = yield
script src="https://login.persona.org/include.js"
= javascript_include_tag 'application', 'data-turbolinks-track' => true

View file

@ -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