simple_user_auth 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/simple_user_auth/version.rb +1 -1
- data/lib/simple_user_auth.rb +3 -3
- metadata +2 -2
data/lib/simple_user_auth.rb
CHANGED
@@ -34,7 +34,7 @@ module SimpleUserAuth
|
|
34
34
|
validates :password,
|
35
35
|
:presence => { :if => :new_record_or_change_password? },
|
36
36
|
:confirmation => { :if => :new_record_or_change_password? },
|
37
|
-
:length => { :
|
37
|
+
:length => { :minimum => 6, :if => :new_record_or_change_password? }
|
38
38
|
before_save :encrypt_password
|
39
39
|
end
|
40
40
|
end
|
@@ -132,8 +132,8 @@ module SimpleUserAuth
|
|
132
132
|
module ClassInstanceMethods
|
133
133
|
|
134
134
|
# Signs in a user, if the second parameter is false (default) the cookie will last only the session.
|
135
|
-
def sign_in(user,
|
136
|
-
if remember_me
|
135
|
+
def sign_in(user, args = {})
|
136
|
+
if args[:remember_me]
|
137
137
|
cookies.permanent.signed[remember_token_name] = [user.id, user.salt]
|
138
138
|
else
|
139
139
|
cookies.signed[remember_token_name] = [user.id, user.salt]
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: simple_user_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.8
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Erich Menge
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-10 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: A simple no frills user authentication gem for my Rails projects.
|