any_login 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/any_login/application.css +3 -0
- data/app/controllers/any_login/application_controller.rb +1 -9
- data/app/views/any_login/_any_login.html.erb +4 -4
- data/app/views/any_login/assets/_css.html.erb +101 -0
- data/app/views/any_login/assets/_js.html.erb +25 -0
- data/app/views/any_login/svg/_user.html.erb +1 -2
- data/config/routes.rb +0 -2
- data/lib/any_login/helpers.rb +3 -1
- data/lib/any_login/providers/devise.rb +1 -1
- data/lib/any_login/version.rb +1 -1
- data/test/rails_apps/authlogic/db/development.sqlite3 +0 -0
- data/test/rails_apps/authlogic/db/test.sqlite3 +0 -0
- data/test/rails_apps/authlogic/db/test.sqlite3-shm +0 -0
- data/test/rails_apps/authlogic/db/test.sqlite3-wal +0 -0
- data/test/rails_apps/authlogic/log/development.log +438 -0
- data/test/rails_apps/authlogic/log/test.log +1144 -0
- data/test/rails_apps/authlogic/tmp/development_secret.txt +1 -0
- data/test/rails_apps/authlogic/tmp/local_secret.txt +1 -0
- data/test/rails_apps/clearance/config/environment.rb +1 -0
- data/test/rails_apps/clearance/db/development.sqlite3 +0 -0
- data/test/rails_apps/clearance/db/test.sqlite3 +0 -0
- data/test/rails_apps/clearance/db/test.sqlite3-shm +0 -0
- data/test/rails_apps/clearance/db/test.sqlite3-wal +0 -0
- data/test/rails_apps/clearance/log/development.log +388 -0
- data/test/rails_apps/clearance/log/test.log +1110 -0
- data/test/rails_apps/clearance/tmp/development_secret.txt +1 -0
- data/test/rails_apps/clearance/tmp/local_secret.txt +1 -0
- data/test/rails_apps/devise/db/development.sqlite3 +0 -0
- data/test/rails_apps/devise/db/schema.rb +4 -4
- data/test/rails_apps/devise/db/test.sqlite3 +0 -0
- data/test/rails_apps/devise/db/test.sqlite3-shm +0 -0
- data/test/rails_apps/devise/db/test.sqlite3-wal +0 -0
- data/test/rails_apps/devise/log/development.log +1081 -0
- data/test/rails_apps/devise/log/test.log +2120 -0
- data/test/rails_apps/devise/tmp/development_secret.txt +1 -0
- data/test/rails_apps/devise/tmp/local_secret.txt +1 -0
- data/test/rails_apps/sorcery/db/development.sqlite3 +0 -0
- data/test/rails_apps/sorcery/db/test.sqlite3 +0 -0
- data/test/rails_apps/sorcery/db/test.sqlite3-shm +0 -0
- data/test/rails_apps/sorcery/db/test.sqlite3-wal +0 -0
- data/test/rails_apps/sorcery/log/development.log +247 -0
- data/test/rails_apps/sorcery/log/test.log +532 -0
- data/test/rails_apps/sorcery/tmp/development_secret.txt +1 -0
- data/test/rails_apps/sorcery/tmp/local_secret.txt +1 -0
- data/test/test_helper_common.rb +2 -1
- metadata +85 -6
- data/app/assets/javascripts/any_login/application.js +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfc947837944c5fd9470108cd402ac191433e9b79d1f49820ff9f7709e5c6d0a
|
4
|
+
data.tar.gz: 13dceae2e364d6a13a694855b1d2539216b1e4c5d7fb93d550a7df8a17ff2ba7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beca6cddab932f7c230a1d5ec979789d72ec54f1b7cea40bfdc56949680641534a0d2c8fe29b8664fa5073abf2324cc9f89d3eb76e6e7d56eef5a248fa96d557
|
7
|
+
data.tar.gz: 9ab1c3b8fb682bc8037e1caa9e741a1d4933676dcc76f3f68746d80a9c1472fca7fd67a73de3734ce7530f6079887c4c90b18265913806c64a81b7c93d1e0141
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module AnyLogin
|
2
2
|
class ApplicationController < ActionController::Base
|
3
|
-
protect_from_forgery
|
3
|
+
protect_from_forgery
|
4
4
|
before_action :try_not_to_leak_any_login_is_installed
|
5
5
|
|
6
6
|
include AnyLogin.provider.constantize::Controller
|
@@ -19,14 +19,6 @@ module AnyLogin
|
|
19
19
|
AnyLogin.provider.constantize::Controller.instance_method(:any_login_sign_in).bind(self).call
|
20
20
|
end
|
21
21
|
|
22
|
-
def css
|
23
|
-
send_file AnyLogin::Engine.root.join('app', 'assets', 'stylesheets', 'any_login', 'application.css'), content_type: 'text/css'
|
24
|
-
end
|
25
|
-
|
26
|
-
def js
|
27
|
-
send_file AnyLogin::Engine.root.join('app', 'assets', 'javascripts', 'any_login', 'application.js'), content_type: 'text/javascript'
|
28
|
-
end
|
29
|
-
|
30
22
|
private
|
31
23
|
|
32
24
|
def try_not_to_leak_any_login_is_installed
|
@@ -1,10 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<%= render 'any_login/assets/js' %>
|
2
|
+
<%= render 'any_login/assets/css' %>
|
3
3
|
|
4
4
|
<div id='any_login' class='<%= any_login_klasses %>'>
|
5
|
-
<%= form_tag any_login.sign_in_path, :
|
5
|
+
<%= form_tag any_login.sign_in_path, method: :post, id: 'any_login_form' do %>
|
6
6
|
<label for="any_login_form_toggle" id="any_login_form_toggle_label">
|
7
|
-
<%= render 'any_login/svg/user', :
|
7
|
+
<%= render 'any_login/svg/user', title: AnyLogin.klass %>
|
8
8
|
</label>
|
9
9
|
<input type="checkbox" id="any_login_form_toggle" <%= AnyLogin.auto_show ? "checked" : "" %>>
|
10
10
|
<span id='any_login_box'>
|
@@ -0,0 +1,101 @@
|
|
1
|
+
<style>
|
2
|
+
#any_login {
|
3
|
+
position: fixed;
|
4
|
+
opacity: 0.5;
|
5
|
+
background: #5c4383;
|
6
|
+
color: white;
|
7
|
+
font-size: 16px;
|
8
|
+
line-height: 20px;
|
9
|
+
z-index: 10000;
|
10
|
+
}
|
11
|
+
|
12
|
+
#any_login form {
|
13
|
+
margin: 0;
|
14
|
+
height: auto;
|
15
|
+
padding: 4px 6px;
|
16
|
+
display: flex;
|
17
|
+
align-items: center;
|
18
|
+
gap: 6px;
|
19
|
+
}
|
20
|
+
|
21
|
+
#any_login #any_login_box {
|
22
|
+
display: none;
|
23
|
+
vertical-align: middle;
|
24
|
+
}
|
25
|
+
|
26
|
+
#any_login_form_toggle {
|
27
|
+
display: none;
|
28
|
+
}
|
29
|
+
|
30
|
+
#any_login_form_toggle[type=checkbox]:checked ~ #any_login_box {
|
31
|
+
display: inline;
|
32
|
+
}
|
33
|
+
|
34
|
+
#any_login input,
|
35
|
+
#any_login select {
|
36
|
+
color: black;
|
37
|
+
padding: 0;
|
38
|
+
margin: 0;
|
39
|
+
height: auto;
|
40
|
+
float: none;
|
41
|
+
text-decoration: none;
|
42
|
+
position: unset;
|
43
|
+
left: auto;
|
44
|
+
top: auto;
|
45
|
+
font-size: auto;
|
46
|
+
line-height: auto;
|
47
|
+
}
|
48
|
+
|
49
|
+
#any_login.any_login_top_left {
|
50
|
+
top: 0;
|
51
|
+
left: 0;
|
52
|
+
}
|
53
|
+
|
54
|
+
#any_login.any_login_top_right {
|
55
|
+
top: 0;
|
56
|
+
right: 0;
|
57
|
+
}
|
58
|
+
|
59
|
+
#any_login.any_login_bottom_left {
|
60
|
+
bottom: 0;
|
61
|
+
left: 0;
|
62
|
+
}
|
63
|
+
|
64
|
+
#any_login.any_login_bottom_right {
|
65
|
+
bottom: 0;
|
66
|
+
right: 0;
|
67
|
+
}
|
68
|
+
|
69
|
+
#any_login svg {
|
70
|
+
cursor: pointer;
|
71
|
+
vertical-align: middle;
|
72
|
+
fill: #fff;
|
73
|
+
}
|
74
|
+
|
75
|
+
#any_login:hover {
|
76
|
+
opacity: 1;
|
77
|
+
}
|
78
|
+
|
79
|
+
#any_login .any_login_user_information {
|
80
|
+
padding-left: 10px;
|
81
|
+
color: yellow;
|
82
|
+
}
|
83
|
+
|
84
|
+
#any_login #any_login_id_input {
|
85
|
+
width: 30px;
|
86
|
+
}
|
87
|
+
|
88
|
+
#any_login span#current_user_information {
|
89
|
+
display: inline;
|
90
|
+
}
|
91
|
+
|
92
|
+
#any_login span#current_user_information span {
|
93
|
+
display: inline;
|
94
|
+
}
|
95
|
+
|
96
|
+
#any_login span#anylogin_back_to_user {
|
97
|
+
padding-left: 15px;
|
98
|
+
color: cyan;
|
99
|
+
display: inline;
|
100
|
+
}
|
101
|
+
</style>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<script>
|
2
|
+
function submitOnChange() {
|
3
|
+
document.getElementById('any_login_form').submit();
|
4
|
+
}
|
5
|
+
|
6
|
+
function elementExists(element) {
|
7
|
+
return typeof (element) != 'undefined' && element != null;
|
8
|
+
}
|
9
|
+
|
10
|
+
function addChangeListenerTo(elementId) {
|
11
|
+
let element = document.getElementById(elementId);
|
12
|
+
if (elementExists(element)) {
|
13
|
+
element.addEventListener("change", submitOnChange);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
function setupAnyLoginHandlers() {
|
18
|
+
addChangeListenerTo("back_to_previous_id");
|
19
|
+
addChangeListenerTo("selected_id");
|
20
|
+
}
|
21
|
+
|
22
|
+
['DOMContentLoaded', 'turbolinks:load', 'turbo:load'].forEach(function(e) {
|
23
|
+
window.addEventListener(e, setupAnyLoginHandlers);
|
24
|
+
});
|
25
|
+
</script>
|
@@ -1,6 +1,5 @@
|
|
1
1
|
<?xml version="1.0" ?>
|
2
|
-
<svg
|
3
|
-
xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
2
|
+
<svg version="1.1" viewBox="0 0 24 24" height="16" width="16" role="img" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
4
3
|
<title><%= title %></title>
|
5
4
|
<g id="info" />
|
6
5
|
<g id="icons">
|
data/config/routes.rb
CHANGED
data/lib/any_login/helpers.rb
CHANGED
@@ -9,7 +9,9 @@ module AnyLogin
|
|
9
9
|
if AnyLogin.enabled
|
10
10
|
|
11
11
|
def any_login_id_input
|
12
|
-
|
12
|
+
def any_login_id_input
|
13
|
+
text_field_tag :id, '', placeholder: 'ID', id: 'any_login_id_input', required: true
|
14
|
+
end
|
13
15
|
end
|
14
16
|
|
15
17
|
def any_login_submit
|
data/lib/any_login/version.rb
CHANGED
Binary file
|
Binary file
|
Binary file
|
File without changes
|