signinable 1.1.1 → 1.1.2
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/README.rdoc +4 -4
- data/lib/signinable/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c913b7acc2d58b8ae8e57b25155c68ed6d2c5130
|
4
|
+
data.tar.gz: 043e61383032626b34a0095c972724f828094076
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8905623c6a611b4467abca0e9c1860da72b4e9d8fbd7415412f318d0bac5c62301a517c11c35669d9f9100308099a8d483803107425c35f257d31445920dc027
|
7
|
+
data.tar.gz: f95b7cfaa3f2449dbd58dea5cbadc8c9e51343aea50c26f1596942746b83ff7ace3cf1855ddafdbc744d760a9a507c05913e6d221e8f79f70838fd3017e5556d
|
data/README.rdoc
CHANGED
@@ -18,7 +18,7 @@ and migrate the database.
|
|
18
18
|
|
19
19
|
Gem does not work with <b>Rails < 3</b>.
|
20
20
|
|
21
|
-
<b>Requires Ruby 1.9.
|
21
|
+
<b>Requires Ruby 1.9.3 or later.</b>
|
22
22
|
|
23
23
|
== Usage
|
24
24
|
|
@@ -30,7 +30,7 @@ Call signinable in an ActiveRecord class to make your model token signinable.
|
|
30
30
|
|
31
31
|
=== 1. Instance methods
|
32
32
|
|
33
|
-
|
33
|
+
user.signin(ip, user_agent, referer)
|
34
34
|
|
35
35
|
This will create and return signin token, which you can store in user cookies or session. For example, in your +session_controller+
|
36
36
|
|
@@ -52,7 +52,7 @@ To signout user in your +session_controller+
|
|
52
52
|
def destroy
|
53
53
|
# your code here
|
54
54
|
|
55
|
-
user.signout(cookies[:signin_token], request.remote_ip, request.user_agent
|
55
|
+
user.signout(cookies[:signin_token], request.remote_ip, request.user_agent)
|
56
56
|
|
57
57
|
# more code here
|
58
58
|
end
|
@@ -75,7 +75,7 @@ Token is passed to +authenticate_with_token+ method on model class. For example,
|
|
75
75
|
|
76
76
|
protected
|
77
77
|
def current_user
|
78
|
-
@current_user ||= User.authenticate_with_token(cookies[:signin_token], request.remote_ip, request.user_agent
|
78
|
+
@current_user ||= User.authenticate_with_token(cookies[:signin_token], request.remote_ip, request.user_agent) if cookies[:signin_token]
|
79
79
|
end
|
80
80
|
|
81
81
|
# you should change this to whatever logic you need
|
data/lib/signinable/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signinable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Novozhenets
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.2.0
|
119
|
+
rubygems_version: 2.2.0
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: Token based signin
|