rails_jwt_auth 1.5.0 → 1.6.0
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 +4 -4
- data/README.md +22 -9
- data/app/controllers/concerns/rails_jwt_auth/params_helper.rb +1 -1
- data/app/controllers/rails_jwt_auth/confirmations_controller.rb +4 -1
- data/app/controllers/rails_jwt_auth/invitations_controller.rb +1 -0
- data/app/controllers/rails_jwt_auth/passwords_controller.rb +6 -1
- data/app/models/concerns/rails_jwt_auth/authenticatable.rb +4 -2
- data/lib/rails_jwt_auth/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc3044428ce08ed3c1dd2db9c7352f5542b89f0786a34f0e9cc87eb37f149049
|
4
|
+
data.tar.gz: b7ebbfd09f4dce43e41150d67b4325712fafac78aef5c9d7081963c267e53fcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1470227b38542cc6d11e218d517e8839fa07bc91d4a8368db8cf61e9e72a9de125a4d3f56e6f0b7c08ed94801e5981a9d023590c052dd36d97a5446d14cfc0c
|
7
|
+
data.tar.gz: 76f0fe0099e7044694ae5612744128861848373692692f4d7627693b6d79b9fb68a89797f1f092904d49dd021bcdd4c8a50a2979fd23a3c0c16bf42aff81820f
|
data/README.md
CHANGED
@@ -197,6 +197,21 @@ end
|
|
197
197
|
|
198
198
|
## Default Controllers API
|
199
199
|
|
200
|
+
| Prefix | Verb | URI Pattern | Controller#Action |
|
201
|
+
| ------------ | ------ | ---------------------------- | ----------------------------------- |
|
202
|
+
| session | DELETE | /session(.:format) | rails_jwt_auth/sessions#destroy |
|
203
|
+
| | POST | /session(.:format) | rails_jwt_auth/sessions#create |
|
204
|
+
| registration | POST | /registration(.:format) | rails_jwt_auth/registrations#create |
|
205
|
+
|confirmations | POST | /confirmations(.:format) | rails_jwt_auth/confirmations#create |
|
206
|
+
| confirmation | PATCH | /confirmations/:id(.:format) | rails_jwt_auth/confirmations#update |
|
207
|
+
| | PUT | /confirmations/:id(.:format) | rails_jwt_auth/confirmations#update |
|
208
|
+
| passwords | POST | /passwords(.:format) | rails_jwt_auth/passwords#create |
|
209
|
+
| password | PATCH | /passwords/:id(.:format) | rails_jwt_auth/passwords#update |
|
210
|
+
| | PUT | /passwords/:id(.:format) | rails_jwt_auth/passwords#update |
|
211
|
+
| invitations | POST | /invitations(.:format) | rails_jwt_auth/invitations#create |
|
212
|
+
| invitation | PATCH | /invitations/:id(.:format) | rails_jwt_auth/invitations#update |
|
213
|
+
| | PUT | /invitations/:id(.:format) | rails_jwt_auth/invitations#update |
|
214
|
+
|
200
215
|
### Session
|
201
216
|
|
202
217
|
Session api is defined by `RailsJwtAuth::SessionsController`.
|
@@ -255,11 +270,9 @@ It is necessary to set a value for `confirmations_url` option into `config/initi
|
|
255
270
|
|
256
271
|
```js
|
257
272
|
{
|
258
|
-
url: host/
|
273
|
+
url: host/confirmations/:token,
|
259
274
|
method: PUT
|
260
|
-
data: {
|
261
|
-
confirmation_token: 'token'
|
262
|
-
}
|
275
|
+
data: {}
|
263
276
|
}
|
264
277
|
```
|
265
278
|
|
@@ -267,7 +280,7 @@ It is necessary to set a value for `confirmations_url` option into `config/initi
|
|
267
280
|
|
268
281
|
```js
|
269
282
|
{
|
270
|
-
url: host/
|
283
|
+
url: host/confirmations,
|
271
284
|
method: POST,
|
272
285
|
data: {
|
273
286
|
confirmation: {
|
@@ -285,7 +298,7 @@ Password api is defined by `RailsJwtAuth::PasswordsController`.
|
|
285
298
|
|
286
299
|
```js
|
287
300
|
{
|
288
|
-
url: host/
|
301
|
+
url: host/passwords,
|
289
302
|
method: POST,
|
290
303
|
data: {
|
291
304
|
password: {
|
@@ -299,10 +312,9 @@ Password api is defined by `RailsJwtAuth::PasswordsController`.
|
|
299
312
|
|
300
313
|
```js
|
301
314
|
{
|
302
|
-
url: host/
|
315
|
+
url: host/passwords/:token,
|
303
316
|
method: PUT,
|
304
317
|
data: {
|
305
|
-
reset_password_token: 'token',
|
306
318
|
password: {
|
307
319
|
password: '1234',
|
308
320
|
password_confirmation: '1234'
|
@@ -356,7 +368,8 @@ Unlock api is provided by `RailsJwtAuth::UnlocksController`.
|
|
356
368
|
```js
|
357
369
|
{
|
358
370
|
url: host/unlocks/:unlock_token,
|
359
|
-
method: PUT
|
371
|
+
method: PUT,
|
372
|
+
data: {}
|
360
373
|
}
|
361
374
|
```
|
362
375
|
|
@@ -4,7 +4,10 @@ module RailsJwtAuth
|
|
4
4
|
include RenderHelper
|
5
5
|
|
6
6
|
def create
|
7
|
-
user = RailsJwtAuth.model.where(
|
7
|
+
user = RailsJwtAuth.model.where(
|
8
|
+
email: confirmation_create_params[RailsJwtAuth.email_field_name]
|
9
|
+
).first
|
10
|
+
|
8
11
|
return render_422(email: [{error: :not_found}]) unless user
|
9
12
|
|
10
13
|
user.send_confirmation_instructions ? render_204 : render_422(user.errors.details)
|
@@ -4,7 +4,12 @@ module RailsJwtAuth
|
|
4
4
|
include RenderHelper
|
5
5
|
|
6
6
|
def create
|
7
|
-
|
7
|
+
return render_422(email: [{error: :blank}]) if password_create_params[:email].blank?
|
8
|
+
|
9
|
+
user = RailsJwtAuth.model.where(
|
10
|
+
email: password_create_params[:email].to_s.strip.downcase
|
11
|
+
).first
|
12
|
+
|
8
13
|
return render_422(email: [{error: :not_found}]) unless user
|
9
14
|
|
10
15
|
user.send_reset_password_instructions ? render_204 : render_422(user.errors.details)
|
@@ -46,8 +46,10 @@ module RailsJwtAuth
|
|
46
46
|
'invalid'
|
47
47
|
end
|
48
48
|
|
49
|
-
#
|
50
|
-
|
49
|
+
# if recoberable module is enabled ensure clean recovery to allow save
|
50
|
+
if self.respond_to? :reset_password_token
|
51
|
+
self.reset_password_token = self.reset_password_sent_at = nil
|
52
|
+
end
|
51
53
|
|
52
54
|
assign_attributes(params)
|
53
55
|
valid? # validates first other fields
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_jwt_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rjurado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|
@@ -120,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
|
124
|
-
rubygems_version: 2.7.3
|
123
|
+
rubygems_version: 3.0.3
|
125
124
|
signing_key:
|
126
125
|
specification_version: 4
|
127
126
|
summary: Rails jwt authentication.
|