authentasaurus 0.6.17 → 0.6.18
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.
@@ -18,9 +18,9 @@ module ActiveRecord::ActsAsAuthenticatable
|
|
18
18
|
end
|
19
19
|
|
20
20
|
|
21
|
-
## Authenticates the username and password
|
22
|
-
def authenticate(
|
23
|
-
user=self.find_by_username
|
21
|
+
## Authenticates the username (or email) and password
|
22
|
+
def authenticate(username_or_email, password, remember = false)
|
23
|
+
user=self.find_by_username(username_or_email) || self.find_by_email(username_or_email)
|
24
24
|
if user
|
25
25
|
expected_password=encrypt_password(password, user.password_seed)
|
26
26
|
unless expected_password == user.hashed_password && user.active
|
@@ -7,9 +7,9 @@ module ActiveRecord::ActsAsAuthenticatableValidatable
|
|
7
7
|
end
|
8
8
|
|
9
9
|
module ClassMethods
|
10
|
-
## Authenticates the username and password
|
11
|
-
def authenticate(
|
12
|
-
user=self.find_by_username
|
10
|
+
## Authenticates the username (or email) and password
|
11
|
+
def authenticate(username_or_email, password, remember = false)
|
12
|
+
user=self.find_by_username(username_or_email) || self.find_by_email(username_or_email)
|
13
13
|
if user
|
14
14
|
expected_password=encrypt_password(password, user.password_seed)
|
15
15
|
unless expected_password == user.hashed_password && user.active && user.validation.nil?
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authentasaurus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 35
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 18
|
10
|
+
version: 0.6.18
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Omar Mekky
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2010-09-
|
21
|
+
date: 2010-09-28 00:00:00 +03:00
|
22
22
|
default_executable:
|
23
23
|
dependencies: []
|
24
24
|
|