breath 0.1.1 → 0.1.2
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: b2785b5ee6dbd2e81dad460ef63f97dcfcb481e93e72d1805019c12911766e55
|
4
|
+
data.tar.gz: 29c3bcfc6c28916d7a5dbf54bb9937688f008d938c2d27135219f4ec34c6dd72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6749ed6e952b1da8a7e5074f33810293c63d1e1629df7390319f6d4e28fa79948df168c25abb1cc0b5d457c30648fd427a62b089c9b40eef6df2892bb9a4a517
|
7
|
+
data.tar.gz: fb538d0d914d31c9e693b64fe24bcc7d615b7c6bacb77fcb70b9c82d05b425614cb94d902fc8e8301383f3a6ea8705f2d5389895ee437489a2f5630d965b246a
|
@@ -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 = "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 send(
|
17
|
-
raise AuthenticationError unless send(
|
16
|
+
raise AuthenticationError if send(current_target).nil?
|
17
|
+
raise AuthenticationError unless send(current_target).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