devise_autosigninable 1.0.0 → 1.0.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.
- data/README.md +5 -2
- data/generators/devise_autosigninable/USAGE +1 -1
- data/lib/devise_autosigninable/model.rb +2 -3
- data/lib/devise_autosigninable/version.rb +1 -1
- data/lib/devise_autosigninable.rb +2 -0
- data/lib/tasks/devise_autosigninable.rake +1 -1
- metadata +6 -12
- data/init.rb +0 -1
- data/install.rb +0 -1
- data/test/devise_autosigninable_test.rb +0 -8
- data/test/test_helper.rb +0 -4
- data/uninstall.rb +0 -1
data/README.md
CHANGED
@@ -9,13 +9,16 @@ Devise Autosigninable signs in a user based on an autosignin token (random hash
|
|
9
9
|
If signed in user try to sign in with Devise Autosigninable he will be sign out firstly and than go to sign in.
|
10
10
|
So if token is incorrect user will be signed out anyway.
|
11
11
|
|
12
|
-
Devise Autosigninable
|
12
|
+
Devise Autosigninable compatibile with Rails 2 and Rails 3
|
13
|
+
|
13
14
|
|
14
15
|
Installation
|
15
16
|
-----------
|
17
|
+
|
18
|
+
|
16
19
|
* Add devise_autosigninable to Gemfile:
|
17
20
|
|
18
|
-
`gem '
|
21
|
+
`gem 'devise_autosigininable', '1.0.0'`
|
19
22
|
|
20
23
|
* Add :autosigninable to your Devise modules in model, for example:
|
21
24
|
|
@@ -12,7 +12,6 @@ module Devise
|
|
12
12
|
# indicator to expire autosignin token
|
13
13
|
mattr_accessor :autosignin_expire
|
14
14
|
@@autosignin_expire = false
|
15
|
-
|
16
15
|
end
|
17
16
|
end
|
18
17
|
|
@@ -70,7 +69,7 @@ module Devise
|
|
70
69
|
|
71
70
|
|
72
71
|
module ClassMethods
|
73
|
-
|
72
|
+
|
74
73
|
RETRY_COUNT = 20
|
75
74
|
|
76
75
|
# Generate autosignin tokens unless already exists and save the records.
|
@@ -104,7 +103,7 @@ module Devise
|
|
104
103
|
|
105
104
|
# Authenticate a user based on authentication token.
|
106
105
|
def authenticate_with_autosignin_token(attributes={})
|
107
|
-
resource = find_by_id(attributes[self.to_s.foreign_key.to_sym])
|
106
|
+
resource = find_by_id(attributes[self.to_s.foreign_key.to_sym].to_i)
|
108
107
|
if resource.try(:valid_for_autosignin_token_authentication?, attributes)
|
109
108
|
resource
|
110
109
|
else
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_autosigninable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrey Deryabin
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-09-27 00:00:00 +04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -40,8 +40,6 @@ files:
|
|
40
40
|
- generators/devise_autosigninable/USAGE
|
41
41
|
- generators/devise_autosigninable/devise_autosigninable_generator.rb
|
42
42
|
- generators/devise_autosigninable/templates/migration.rb
|
43
|
-
- init.rb
|
44
|
-
- install.rb
|
45
43
|
- lib/devise_autosigninable.rb
|
46
44
|
- lib/devise_autosigninable/model.rb
|
47
45
|
- lib/devise_autosigninable/routes.rb
|
@@ -51,9 +49,6 @@ files:
|
|
51
49
|
- lib/devise_autosigninable/view_helpers.rb
|
52
50
|
- lib/tasks/devise_autosigninable.rake
|
53
51
|
- rails/init.rb
|
54
|
-
- test/devise_autosigninable_test.rb
|
55
|
-
- test/test_helper.rb
|
56
|
-
- uninstall.rb
|
57
52
|
has_rdoc: true
|
58
53
|
homepage: http://github.com/evilmartians/devise_autosigninable
|
59
54
|
licenses: []
|
@@ -88,6 +83,5 @@ rubygems_version: 1.6.2
|
|
88
83
|
signing_key:
|
89
84
|
specification_version: 3
|
90
85
|
summary: It adds support to be logged in by uniq link. It useful for mailing and access from admin panel.
|
91
|
-
test_files:
|
92
|
-
|
93
|
-
- test/test_helper.rb
|
86
|
+
test_files: []
|
87
|
+
|
data/init.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Include hook code here
|
data/install.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Install hook code here
|
data/test/test_helper.rb
DELETED
data/uninstall.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Uninstall hook code here
|