wire-framework 0.1.0 → 0.1.1
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/app/login.rb +1 -1
- data/lib/closet/context.rb +5 -4
- data/lib/wire.rb +1 -1
- 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: fc95a1d2992da538b6e293caaf844457b07e81cb
|
4
|
+
data.tar.gz: b91741b768ebd3a93a5483acfbfded3c0b0279f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21fb314e3cb072d623e088fd708121cf42a7ec2963326b70f72d15eeaf7ec9aaaf752a624cdd3b596978c897f68a4b21662f0bfd014995e161883e4fcd85c9d6
|
7
|
+
data.tar.gz: af1059d2df5b7f8807777790e5e82851c44ba41fe59e437c806922189a565083427b8be18c6da68fd04ea2c69f935267209e3f521786fbbb133c6ea4dcb350c3
|
data/lib/app/login.rb
CHANGED
@@ -8,7 +8,7 @@ module Login
|
|
8
8
|
# @return [Response] a redirect message returning to the previous page
|
9
9
|
def self.invoke(actions, context)
|
10
10
|
referer = context.referer
|
11
|
-
[
|
11
|
+
[307, { 'Location' => referer.join('/') }, ['Login Redirect']]
|
12
12
|
end
|
13
13
|
|
14
14
|
end
|
data/lib/closet/context.rb
CHANGED
@@ -56,9 +56,10 @@ module Wire
|
|
56
56
|
# @param [Hash] env the Rack environment
|
57
57
|
# @return [Hash] the updated environment
|
58
58
|
def update_session(env)
|
59
|
-
user
|
60
|
-
|
61
|
-
|
59
|
+
user = request.env['HTTP_REMOTE_USER']
|
60
|
+
unless user.nil? or user.eql? 'nobody' or user.eql? '(null)'
|
61
|
+
env['rack.session']['user'] = user
|
62
|
+
end
|
62
63
|
env
|
63
64
|
end
|
64
65
|
|
@@ -67,7 +68,7 @@ module Wire
|
|
67
68
|
# @return [Context] a new Context
|
68
69
|
def initialize(env)
|
69
70
|
@env = update_session(env)
|
70
|
-
@user = env['rack.session'][
|
71
|
+
@user = env['rack.session']['user']
|
71
72
|
@verb = HTTP_VERBS[env['REQUEST_METHOD']]
|
72
73
|
@action = HTTP_ACTIONS[env['REQUEST_METHOD']]
|
73
74
|
if env['HTTP_REFERER']
|
data/lib/wire.rb
CHANGED