warden-token 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/warden/strategies/token.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d21561c777fbac063c878a280460abd4d3d623e7
|
4
|
+
data.tar.gz: ed642e12393aba24eb38a04515e221e9278ad0dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fbcec9bc2a42145a4040ec7e9a1dcdff97fecd78f0677d1c6727f594a6116c63c1a9b9b9d6358954dc78e187ee103e4723881971dd3e6a6f0fa3f6ce9ebd799
|
7
|
+
data.tar.gz: 0a8bcb3586db8a4b74bc67b2e3029d7c5997b90db7bc3b80882972d80064ad072da4d9d57abb925f8eb901c1bfa0757a2bee0ff4cc9047e3a500b97ee366c104
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "warden"
|
2
2
|
|
3
3
|
class Warden::Strategies::Token < ::Warden::Strategies::Base
|
4
|
-
VERSION = "0.1.
|
4
|
+
VERSION = "0.1.1"
|
5
5
|
|
6
6
|
attr_reader :id, :token
|
7
7
|
|
@@ -21,7 +21,7 @@ class Warden::Strategies::Token < ::Warden::Strategies::Base
|
|
21
21
|
|
22
22
|
def authenticate!
|
23
23
|
user = User.where(id: id).first
|
24
|
-
if user &&
|
24
|
+
if user && secure_compare(user.auth_token)
|
25
25
|
success!(user)
|
26
26
|
else
|
27
27
|
fail!("Invalid user id or token")
|