red_token_auth 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -3
- data/lib/red_token_auth.rb +1 -0
- data/lib/red_token_auth/controllers/authentication.rb +1 -1
- data/lib/red_token_auth/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aef13fd2edcda81c3b5333e9820c871ba18b397b
|
4
|
+
data.tar.gz: 775d144b9d7e70aeea4c621a5a01cf02a91c7e41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b467321147ff87a17fc66dd055085709bd9d51c3810e9a6a930ec67d3aef30aae2da2ba71fe39b53ddd715f4b8bf381b3a7a8d25f539d284ddf38bf0f54a22cd
|
7
|
+
data.tar.gz: c3f47a1799cee1eec0d13b729ddc11a76938f05aaa1a1544ccd500e313a4c5e636c6fa05e2525dba53150164fc0be7d5961698ca72b68919570d30ace3de36c7
|
data/README.md
CHANGED
@@ -36,8 +36,6 @@ You'll be able to include the module in the model like so.
|
|
36
36
|
class User
|
37
37
|
include Mongoid::Document
|
38
38
|
include RedTokenAuth
|
39
|
-
# Include this if you intend to use OmniAuth
|
40
|
-
include RedTokenAuth::Omniauthable
|
41
39
|
|
42
40
|
# Mandatory fields for this gem.
|
43
41
|
field :email, type: String
|
@@ -45,7 +43,6 @@ class User
|
|
45
43
|
field :reset_password_token, type: String
|
46
44
|
field :reset_password_token_sent_at, type: Time
|
47
45
|
field :authentication_token, type: String
|
48
|
-
# You'll need these fields if you are working with Omniauth.
|
49
46
|
field :uid, type: String
|
50
47
|
# Default must be "email".
|
51
48
|
field :provider, type: String, default: "email"
|
data/lib/red_token_auth.rb
CHANGED
@@ -12,7 +12,7 @@ module RedTokenAuth
|
|
12
12
|
klass = resource.to_s.capitalize.constantize
|
13
13
|
|
14
14
|
#TODO: make this query configurable.
|
15
|
-
@resource = klass.where(
|
15
|
+
@resource = klass.where(uid: request.headers["uid"]).first
|
16
16
|
|
17
17
|
unless @resource && @resource.authenticate_token(request.headers["access-token"])
|
18
18
|
render_unauthorized
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: red_token_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caio Ergos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
183
|
rubyforge_project:
|
184
|
-
rubygems_version: 2.6.
|
184
|
+
rubygems_version: 2.6.12
|
185
185
|
signing_key:
|
186
186
|
specification_version: 4
|
187
187
|
summary: Simple token based authentication for Mongoid.
|