model_token_auth 1.0.2 → 1.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c542c166ce15242b61e7c00ff7608c6dbad07ffdbc692880be57a960f02887d6
4
- data.tar.gz: 89807db3b9b960c5c316c57cd4a0b66ae0fc6b5e2b9ad6d554aaf719c77d1fa1
3
+ metadata.gz: 4a3527ddbe35d5c795b9d4de1d5a07f1f7e42dd24c3b65511ad9a481de22a4a6
4
+ data.tar.gz: f2c38cf208b737e3f79a3ee65ce4f6df542778c55f7baba2886465be6f38c3a6
5
5
  SHA512:
6
- metadata.gz: fe916c969fd32217f82fd4d49b06f3ba6f4c7a5f90dec4946da6d46284219117a9c60141ea20a410e91a44e5ddb98227a0f117f5f205fd84bf4e373f6978daa3
7
- data.tar.gz: 0ba8eb09ce0fb3f5a820f7229817e298d6de8c637ecf3838337e74819c17ac417493684a094aa174d7f02b7f19bbddb8335145bb453095cadbc4b4f71ca6014c
6
+ metadata.gz: 824f224bc51be881696672ce094905916b60d05246445627baaaee9ba86b1474e997f98693b4e04ae34ccc984d2962bb5f942d6ca06bf749d961e22602e7c24f
7
+ data.tar.gz: 40037a69c81623ba04223a4826a5adc929d4e528f4892108c599b7575bac0e3036e3862555a6f287b0d8288dcf83ef899a1901837763e09ebc4f22cdfb98ec7f
data/README.md CHANGED
@@ -6,15 +6,16 @@ Generates tokens in models and authentication in the controllers.
6
6
 
7
7
  ## Usage
8
8
 
9
- This plugin handles Token API authentication for models. In models in which
9
+ This plugin handles Token authentication for models. In models in which
10
10
  `#acts_as_model_authenticable` method is called, the instances will be able generating
11
11
  a token by calling the methods `#save`, `#create` and `#create!`of ActiveRecord. The
12
12
  token is generated in an associated model called AccessToken.
13
13
 
14
14
  The plugin also handles authentication in the controllers by inserting a generic
15
15
  `#authenticate!` method in ActionController::Base or ActionController::API that
16
- will verify the existence of the token and creates the `current_*` method by adding
17
- a header `X-Auth-Token` in the request with a token as a value.
16
+ will verify the existence of the token and creates the `current_*` method.
17
+
18
+ To authenticate some token it'll need adding the header `X-Auth-Token` in the request with a token as a value.
18
19
 
19
20
  ### Models
20
21
 
@@ -96,12 +97,26 @@ Add this line to your application's Gemfile:
96
97
  gem 'model_token_auth'
97
98
  ```
98
99
 
99
- And then execute:
100
+ Then execute:
100
101
 
101
102
  ```bash
102
103
  $ bundle
103
104
  ```
104
105
 
106
+ In your project directory:
107
+
108
+ ```bash
109
+ $ rails generate access_token
110
+ ```
111
+
112
+ This will generate a migration, then:
113
+
114
+ ```bash
115
+ $ rake db:migrate
116
+ ```
117
+
118
+ Once the migration finishes, the models will be ready to be authenticated.
119
+
105
120
  ## Contributing
106
121
 
107
122
  Bug report or pull request are welcome.
@@ -1,3 +1,3 @@
1
1
  module ModelTokenAuth
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_token_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Armando Alejandre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-22 00:00:00.000000000 Z
11
+ date: 2019-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails