prx_auth-rails 1.5.0 → 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/config/prx_auth-rails_manifest.js +3 -0
- data/app/assets/images/prx_auth-rails/user.svg +5 -0
- data/app/assets/javascripts/prx_auth-rails/user_widget.js.erb +44 -0
- data/app/assets/stylesheets/prx_auth-rails/user_widget.css +69 -0
- data/config/initializers/assets.rb +1 -0
- data/lib/prx_auth/rails/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf8c434fb9b4854b2dd16dd7a49a9cfbf3adcc371269e93b8fe0b1c82f7d8e44
|
4
|
+
data.tar.gz: 2402bb437ecfb9873dee6fc5763a7fb63005549f78e8fa6d36315a08aacc50e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aac974b86051fb56c34cfc95526cff184f8301c7f109e3f2965be8b0db6bdbae79c2099ef768317354381333bb88c60de1608c1feeab0d8d075f54937590684
|
7
|
+
data.tar.gz: f9042ad439ac44c6d7e3d9d3813cbf7940ad421a9ef536e2e80e9bed1f4bbaf8f28cc6371f14b237a2bd303c2d53dbdc745acaae21de7498cf4b9c209a8f9948
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg width="100%" height="100%" viewBox="0 0 51 51" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
|
4
|
+
<path d="M51,25.5C51,11.44 39.56,0 25.5,0C11.44,0 0,11.44 0,25.5C0,32.927 3.194,39.621 8.277,44.285L8.253,44.306L9.08,45.003C9.134,45.049 9.192,45.086 9.246,45.13C9.685,45.495 10.141,45.841 10.604,46.175C10.755,46.284 10.905,46.392 11.058,46.498C11.553,46.839 12.061,47.163 12.58,47.47C12.693,47.537 12.807,47.602 12.922,47.666C13.49,47.99 14.07,48.295 14.665,48.575C14.708,48.596 14.753,48.614 14.796,48.635C16.734,49.535 18.801,50.196 20.964,50.586C21.02,50.597 21.077,50.607 21.134,50.617C21.806,50.733 22.485,50.826 23.172,50.888C23.255,50.895 23.339,50.9 23.423,50.907C24.107,50.964 24.799,51 25.5,51C26.195,51 26.88,50.964 27.56,50.909C27.647,50.902 27.733,50.897 27.819,50.89C28.501,50.828 29.174,50.738 29.839,50.624C29.896,50.613 29.955,50.603 30.012,50.592C32.142,50.21 34.18,49.564 36.092,48.686C36.163,48.654 36.234,48.623 36.305,48.59C36.877,48.321 37.436,48.031 37.984,47.722C38.12,47.645 38.256,47.567 38.391,47.487C38.89,47.194 39.38,46.887 39.857,46.56C40.029,46.443 40.196,46.32 40.366,46.198C40.773,45.905 41.173,45.602 41.561,45.286C41.648,45.217 41.74,45.156 41.825,45.085L42.673,44.376L42.648,44.355C47.776,39.689 51,32.965 51,25.5ZM1.855,25.5C1.855,12.462 12.462,1.855 25.5,1.855C38.538,1.855 49.145,12.462 49.145,25.5C49.145,32.526 46.062,38.843 41.181,43.177C40.908,42.988 40.634,42.82 40.353,42.679L32.502,38.754C31.797,38.401 31.359,37.693 31.359,36.905L31.359,34.164C31.541,33.939 31.733,33.685 31.932,33.406C32.948,31.971 33.763,30.374 34.357,28.656C35.532,28.097 36.291,26.927 36.291,25.606L36.291,22.319C36.291,21.515 35.996,20.735 35.468,20.122L35.468,15.794C35.516,15.312 35.687,12.597 33.722,10.357C32.013,8.406 29.247,7.418 25.5,7.418C21.753,7.418 18.987,8.406 17.278,10.356C15.313,12.596 15.484,15.313 15.532,15.793L15.532,20.121C15.005,20.734 14.709,21.514 14.709,22.318L14.709,25.605C14.709,26.626 15.167,27.578 15.952,28.221C16.703,31.163 18.249,33.39 18.82,34.145L18.82,36.828C18.82,37.585 18.407,38.281 17.742,38.644L10.41,42.643C10.177,42.77 9.945,42.919 9.713,43.085C4.892,38.753 1.855,32.475 1.855,25.5Z" style="fill:white;fill-rule:nonzero;"/>
|
5
|
+
</svg>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
// https://stackoverflow.com/questions/8578617/inject-a-script-tag-with-remote-src-and-wait-for-it-to-execute
|
2
|
+
function prxInjectScript(src, callback) {
|
3
|
+
const script = document.createElement('script');
|
4
|
+
|
5
|
+
script.type = 'text/javascript';
|
6
|
+
script.async = false;
|
7
|
+
script.src = src;
|
8
|
+
|
9
|
+
script.onload = function () { script.onload = null; callback(); }
|
10
|
+
|
11
|
+
document.getElementsByTagName('head')[0].appendChild(script);
|
12
|
+
}
|
13
|
+
|
14
|
+
document.addEventListener('DOMContentLoaded', function () {
|
15
|
+
const idHost = 'https://<%= PrxAuth::Rails.configuration.id_host %>';
|
16
|
+
const scriptUrl = idHost + '/widget.js';
|
17
|
+
|
18
|
+
prxInjectScript(scriptUrl, function () {
|
19
|
+
const signIn = new PRXSignIn(idHost);
|
20
|
+
|
21
|
+
signIn.signedIn(function (prx) {
|
22
|
+
const widget = document.getElementById('prx-user-widget');
|
23
|
+
const account = document.getElementById('prx-user-widget-menu-account');
|
24
|
+
|
25
|
+
if (!prx.userinfo) {
|
26
|
+
// Not logged in
|
27
|
+
widget.classList.add('no-user-info');
|
28
|
+
|
29
|
+
const url = idHost + '/session?return_to=' + encodeURIComponent(window.location);
|
30
|
+
|
31
|
+
account.innerHTML = '<a class=sign-in href="' + url + '">Sign in</a>';
|
32
|
+
} else {
|
33
|
+
// Logged in
|
34
|
+
widget.classList.add('user-info');
|
35
|
+
|
36
|
+
const account = document.getElementById('prx-user-widget-menu-account');
|
37
|
+
account.innerText = prx.userinfo.email;
|
38
|
+
|
39
|
+
signIn.listApps('prx-user-widget-menu-apps');
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
});
|
44
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
#prx-user-widget {
|
2
|
+
display: flex;
|
3
|
+
flex-direction: column;
|
4
|
+
height: 100%;
|
5
|
+
justify-content: center;
|
6
|
+
padding: 0 20px;
|
7
|
+
position: absolute;
|
8
|
+
right: 0;
|
9
|
+
transition-property: opacity;
|
10
|
+
transition-duration: 0.2s;
|
11
|
+
}
|
12
|
+
@media (max-width: ) {
|
13
|
+
#prx-user-widget {
|
14
|
+
height: auto;
|
15
|
+
top: 0;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
#prx-user-widget:hover {
|
19
|
+
}
|
20
|
+
#prx-user-widget:hover .user-icon {
|
21
|
+
opacity: 1;
|
22
|
+
}
|
23
|
+
#prx-user-widget:hover #prx-user-widget-menu {
|
24
|
+
display: block;
|
25
|
+
}
|
26
|
+
#prx-user-widget .user-icon {
|
27
|
+
cursor: pointer;
|
28
|
+
height: 2em;
|
29
|
+
opacity: 0.7;
|
30
|
+
width: 2em;
|
31
|
+
}
|
32
|
+
#prx-user-widget #prx-user-widget-menu {
|
33
|
+
background-color: #1a1a1a;
|
34
|
+
display: none;
|
35
|
+
right: 0;
|
36
|
+
padding: 10px 20px;
|
37
|
+
position: absolute;
|
38
|
+
top: 100%;
|
39
|
+
z-index: 999;
|
40
|
+
display: none;
|
41
|
+
}
|
42
|
+
|
43
|
+
#prx-user-widget #prx-user-widget-menu h1 {
|
44
|
+
color: white;
|
45
|
+
font-size: .9em;
|
46
|
+
font-weight: 700;
|
47
|
+
}
|
48
|
+
|
49
|
+
#prx-user-widget #prx-user-widget-menu-apps {
|
50
|
+
padding: 0;
|
51
|
+
}
|
52
|
+
#prx-user-widget #prx-user-widget-menu-apps ul {
|
53
|
+
border-top: 1px solid #ddd;
|
54
|
+
padding: 15px 0 0;
|
55
|
+
}
|
56
|
+
|
57
|
+
#prx-user-widget #prx-user-widget-menu-apps ul li a {
|
58
|
+
display: block;
|
59
|
+
font-weight: normal;
|
60
|
+
opacity: 0.7;
|
61
|
+
padding: 5px 0;
|
62
|
+
text-transform: none;
|
63
|
+
}
|
64
|
+
#prx-user-widget #prx-user-widget-menu-apps ul li a:hover {
|
65
|
+
opacity: 1;
|
66
|
+
}
|
67
|
+
.prx-home #prx-user-widget.loaded:hover {
|
68
|
+
background: transparent;
|
69
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.assets.precompile << %w(prx_auth-rails_manifest.js)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prx_auth-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Rhoden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -165,9 +165,14 @@ files:
|
|
165
165
|
- LICENSE.txt
|
166
166
|
- README.md
|
167
167
|
- Rakefile
|
168
|
+
- app/assets/config/prx_auth-rails_manifest.js
|
169
|
+
- app/assets/images/prx_auth-rails/user.svg
|
170
|
+
- app/assets/javascripts/prx_auth-rails/user_widget.js.erb
|
171
|
+
- app/assets/stylesheets/prx_auth-rails/user_widget.css
|
168
172
|
- app/controllers/prx_auth/rails/sessions_controller.rb
|
169
173
|
- app/views/prx_auth/rails/sessions/auth_error.html.erb
|
170
174
|
- app/views/prx_auth/rails/sessions/show.html.erb
|
175
|
+
- config/initializers/assets.rb
|
171
176
|
- config/routes.rb
|
172
177
|
- lib/prx_auth/rails.rb
|
173
178
|
- lib/prx_auth/rails/configuration.rb
|