breath 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/breath/controller/application_controller_helper.rb +3 -3
- data/lib/breath/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50ebd07a8e36d441f618c760f7a5a24fa18d9ac94ddb4a6bdc900cfdb3e359ca
|
4
|
+
data.tar.gz: d260c09a3bee03dc94022e6b579b344c26cc297ccede0dfd858ab12952d67690
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4714402fea80ecc8cb5f3d1a1462ef7f28a36d8c6b3abea415aca82b71ae460f5537f931441dd80d3c67064313c63c0ab564f069050011d129f39a2ec91e4561
|
7
|
+
data.tar.gz: 24ff2a754e289c97a9953a29f42b88a311e886b80c2f97a7c5a879bb3939c981c2ad432c75d77255b851a11503ac4e9b72b7edb3fef67a8ee3ae7119ecb5021d
|
@@ -7,14 +7,14 @@ module Breath
|
|
7
7
|
included do
|
8
8
|
target_class = to_s.split("::")[-2].singularize.constantize
|
9
9
|
target_name = target_class.to_s.underscore
|
10
|
-
|
10
|
+
current_target_name = "current_#{target_name}"
|
11
11
|
|
12
12
|
include ActionController::Cookies
|
13
13
|
|
14
14
|
define_method :authenticate! do
|
15
15
|
raise AuthenticationError unless cookies.key?("#{target_name}_id".to_sym)
|
16
|
-
raise AuthenticationError if
|
17
|
-
raise AuthenticationError unless
|
16
|
+
raise AuthenticationError if send(current_target_name).nil?
|
17
|
+
raise AuthenticationError unless send(current_target_name).remember?(cookies[:remember_token])
|
18
18
|
|
19
19
|
target = target_class.enabled.find_by(id: cookies.signed["#{target_name}_id".to_sym])
|
20
20
|
|
data/lib/breath/version.rb
CHANGED