registrar-rails 0.0.13.alpha → 0.1.0.alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/registrar/rails/controller_extensions.rb +23 -25
- data/lib/registrar/rails/version.rb +1 -1
- data/test/dummy/log/test.log +18 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f36923d9b6c4c211f9793f90b9d0f96c85c6911
|
4
|
+
data.tar.gz: d8cdd0cfb9c99d4094adf1b1b5fb36982a706145
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc76cc7d8000abca939d10f814777e42f8a202f8a2c0221ddba802ee2248039a6e72df122cfcd3aeabe6e9ef55aaa6f26a3c78c61eff0a94d9f9c79221071714
|
7
|
+
data.tar.gz: b5719556812ca6c090dc9fbc75d41736ea6872951d5b7524644d72573513d9f0a9de04001d3ce7d820e8186e19c1cde96ed591ea2a3a3dcab22665993982d7fb
|
@@ -7,7 +7,6 @@ module Registrar
|
|
7
7
|
|
8
8
|
klass.class_eval do
|
9
9
|
helper_method :current_profile
|
10
|
-
helper_method :reload_current_profile
|
11
10
|
helper_method :current_profile?
|
12
11
|
helper_method :logout
|
13
12
|
end
|
@@ -23,40 +22,20 @@ module Registrar
|
|
23
22
|
end
|
24
23
|
end
|
25
24
|
|
26
|
-
def store_current_profile_uid(registrar_profile)
|
27
|
-
session[CURRENT_PROFILE_UID] = registrar_profile.uid
|
28
|
-
end
|
29
|
-
|
30
|
-
def current_profile_uid
|
31
|
-
session[CURRENT_PROFILE_UID]
|
32
|
-
end
|
33
|
-
|
34
25
|
def logout
|
35
26
|
session[CURRENT_PROFILE_UID] = nil
|
36
27
|
end
|
37
28
|
|
38
|
-
def reload_current_profile
|
39
|
-
end
|
40
|
-
|
41
29
|
def current_profile
|
42
|
-
return @
|
30
|
+
return @current_profile if @current_profile
|
43
31
|
|
44
|
-
if
|
45
|
-
@
|
32
|
+
if current_profile_uid_from_session
|
33
|
+
@current_profile = Registrar::Middleware::config.handler.call(
|
46
34
|
build_current_profile
|
47
35
|
)
|
48
36
|
end
|
49
37
|
|
50
|
-
@
|
51
|
-
end
|
52
|
-
|
53
|
-
def build_current_profile
|
54
|
-
{
|
55
|
-
"provider" => {
|
56
|
-
"name" => "session",
|
57
|
-
"uid" => current_profile_uid
|
58
|
-
}
|
59
|
-
}
|
38
|
+
@current_profile
|
60
39
|
end
|
61
40
|
|
62
41
|
def current_profile?
|
@@ -66,6 +45,25 @@ module Registrar
|
|
66
45
|
def authentication_phase?
|
67
46
|
params[:controller] == 'authentication' && params[:action] = 'callback'
|
68
47
|
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def store_current_profile_uid(registrar_profile)
|
52
|
+
session[CURRENT_PROFILE_UID] = registrar_profile.uid
|
53
|
+
end
|
54
|
+
|
55
|
+
def current_profile_uid_from_session
|
56
|
+
session[CURRENT_PROFILE_UID]
|
57
|
+
end
|
58
|
+
|
59
|
+
def build_current_profile
|
60
|
+
{
|
61
|
+
"provider" => {
|
62
|
+
"name" => "session",
|
63
|
+
"uid" => current_profile_uid_from_session
|
64
|
+
}
|
65
|
+
}
|
66
|
+
end
|
69
67
|
end
|
70
68
|
end
|
71
69
|
end
|
data/test/dummy/log/test.log
CHANGED
@@ -878,3 +878,21 @@ CurrentProfileTest: test_exposes_current_profile_if_registrar.profile_is_avaliab
|
|
878
878
|
Started GET "/" for 127.0.0.1 at 2015-06-02 11:19:44 +0200
|
879
879
|
Processing by SomeController#index as HTML
|
880
880
|
Completed 200 OK in 14ms (Views: 0.2ms)
|
881
|
+
----------------------------------------------------------------------------------
|
882
|
+
CurrentProfileTest: test_exposes_current_profile_if_registrar.profile_is_avaliable
|
883
|
+
----------------------------------------------------------------------------------
|
884
|
+
Started GET "/" for 127.0.0.1 at 2015-06-02 17:21:48 +0200
|
885
|
+
Processing by SomeController#index as HTML
|
886
|
+
Completed 500 Internal Server Error in 17ms
|
887
|
+
----------------------------------------------------------------------------------
|
888
|
+
CurrentProfileTest: test_exposes_current_profile_if_registrar.profile_is_avaliable
|
889
|
+
----------------------------------------------------------------------------------
|
890
|
+
Started GET "/" for 127.0.0.1 at 2015-06-02 17:22:04 +0200
|
891
|
+
Processing by SomeController#index as HTML
|
892
|
+
Completed 200 OK in 14ms (Views: 0.1ms)
|
893
|
+
----------------------------------------------------------------------------------
|
894
|
+
CurrentProfileTest: test_exposes_current_profile_if_registrar.profile_is_avaliable
|
895
|
+
----------------------------------------------------------------------------------
|
896
|
+
Started GET "/" for 127.0.0.1 at 2015-06-02 17:24:43 +0200
|
897
|
+
Processing by SomeController#index as HTML
|
898
|
+
Completed 200 OK in 14ms (Views: 0.2ms)
|