devise_jwt_auth 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/devise_jwt_auth/application_controller.rb +1 -2
- data/app/controllers/devise_jwt_auth/concerns/{set_user_by_jwt_token.rb → set_user_by_token.rb} +1 -1
- data/lib/devise_jwt_auth/version.rb +1 -1
- data/test/dummy/app/controllers/application_controller.rb +1 -1
- data/test/dummy/tmp/generators/config/initializers/devise_jwt_auth.rb +13 -13
- data/test/dummy/tmp/generators/db/migrate/{20200209225557_devise_jwt_auth_create_azpire_v1_human_resource_users.rb → 20200210193225_devise_jwt_auth_create_azpire_v1_human_resource_users.rb} +0 -0
- metadata +4 -10
- data/test/dummy/tmp/generators/app/models/mang.rb +0 -9
- data/test/dummy/tmp/generators/config/routes.rb +0 -9
- data/test/dummy/tmp/generators/db/migrate/20200209225557_devise_jwt_auth_create_mangs.rb +0 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7477d1f078d762ffca1b359a0b487d33816238f9cde0567a9e35731eb323b65e
|
4
|
+
data.tar.gz: ebed2ca767f26b34ccae1cde42ec8c62352f3cbb14a11e2f3f6c2566217b0ee5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb35296a86e539a9464bb086a7a2c25802a258f5e9de9f9b9eb177d93f2d0fac20767eed1115a9b9910c67a1e2f806ca16a7cd334356b1e74653ad19015164c5
|
7
|
+
data.tar.gz: df54db926c3e38c54fcf46f284491f13e8b4f5c1be052aebbb2d2ce007139749a67b6c1e91104f39ca6f95c90f355fa168bb32a2879d0c9d83e727b199fe6d6d
|
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
module DeviseJwtAuth
|
4
4
|
class ApplicationController < DeviseController
|
5
|
-
|
6
|
-
include DeviseJwtAuth::Concerns::SetUserByJwtToken
|
5
|
+
include DeviseJwtAuth::Concerns::SetUserByToken
|
7
6
|
|
8
7
|
def resource_data(opts = {})
|
9
8
|
response_data = opts[:resource_json] || @resource.as_json
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class ApplicationController < ActionController::Base
|
4
|
-
include DeviseJwtAuth::Concerns::
|
4
|
+
include DeviseJwtAuth::Concerns::SetUserByToken
|
5
5
|
|
6
6
|
before_action :configure_permitted_parameters, if: :devise_controller?
|
7
7
|
|
@@ -5,38 +5,38 @@ DeviseJwtAuth.setup do |config|
|
|
5
5
|
# user. To receive new access tokens, you should either reauthenticate or
|
6
6
|
# use the HTTP only refresh cookie that is sent during the authentication
|
7
7
|
# process and make refresh token requests.
|
8
|
-
#
|
8
|
+
# config.send_new_access_token_on_each_request = false
|
9
9
|
|
10
10
|
# By default, refresh token HTTP Only cookies last for 2 weeks. These tokens
|
11
11
|
# are used for requesting shorter-lived acccess tokens.
|
12
|
-
#
|
12
|
+
# config.refresh_token_lifespan = 2.weeks
|
13
13
|
|
14
14
|
# By default, access tokens last for 15 minutes. These tokens are used to
|
15
15
|
# access protected resources. When these tokens expire, you need to
|
16
16
|
# reauthenticate the user or use a refresh token cookie to get a new access
|
17
17
|
# token.
|
18
|
-
#
|
18
|
+
# config.access_token_lifespan = 15.minutes
|
19
19
|
|
20
20
|
# This is the name of the HTTP Only cookie that will be sent to the client
|
21
21
|
# for the purpose of requesting new access tokens.
|
22
|
-
#
|
22
|
+
# config.refresh_token_name = 'refresh-token'
|
23
23
|
|
24
24
|
# This is the name of the token that will be sent in the JSON responses used
|
25
25
|
# for accessing protected resources. NEVER store this token in a cookie or
|
26
26
|
# any form of local storage on the client. Save it in memory as a javascript
|
27
27
|
# variable or in some kind of context manager like Redux. Send it in your
|
28
28
|
# request headers when you want to be authenticated.
|
29
|
-
#
|
29
|
+
# config.access_token_name = 'access-token'
|
30
30
|
|
31
31
|
# This is the refresh token encryption key. You should set this in an
|
32
32
|
# environment variable or secret key base that isn't store in a repository.
|
33
33
|
# Also, its a good idea to NOT use the same key for access tokens.
|
34
|
-
|
34
|
+
config.refresh_token_encryption_key = 'your-refresh-token-secret-key-here'
|
35
35
|
|
36
36
|
# This is the refresh token encryption key. You should set this in an
|
37
37
|
# environment variable or secret key base that isn't store in a repository.
|
38
38
|
# Also, its a good idea to NOT use the same key for access tokens.
|
39
|
-
|
39
|
+
config.access_token_encryption_key = 'your-access-token-secret-key-here'
|
40
40
|
|
41
41
|
# This route will be the prefix for all oauth2 redirect callbacks. For
|
42
42
|
# example, using the default '/omniauth', the github oauth2 provider will
|
@@ -64,11 +64,11 @@ DeviseJwtAuth.setup do |config|
|
|
64
64
|
# config.send_confirmation_email = true
|
65
65
|
|
66
66
|
# TODO: Document these settings
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
67
|
+
# config.default_confirm_success_url = nil
|
68
|
+
# config.default_password_reset_url = nil
|
69
|
+
# config.redirect_whitelist = nil
|
70
|
+
# config.update_token_version_after_password_reset = true
|
71
|
+
# config.bypass_sign_in = true
|
72
|
+
# config.require_client_password_reset_token = false
|
73
73
|
|
74
74
|
end
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_jwt_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron A
|
@@ -194,7 +194,7 @@ files:
|
|
194
194
|
- Rakefile
|
195
195
|
- app/controllers/devise_jwt_auth/application_controller.rb
|
196
196
|
- app/controllers/devise_jwt_auth/concerns/resource_finder.rb
|
197
|
-
- app/controllers/devise_jwt_auth/concerns/
|
197
|
+
- app/controllers/devise_jwt_auth/concerns/set_user_by_token.rb
|
198
198
|
- app/controllers/devise_jwt_auth/confirmations_controller.rb
|
199
199
|
- app/controllers/devise_jwt_auth/omniauth_callbacks_controller.rb
|
200
200
|
- app/controllers/devise_jwt_auth/passwords_controller.rb
|
@@ -349,11 +349,8 @@ files:
|
|
349
349
|
- test/dummy/db/schema.rb
|
350
350
|
- test/dummy/lib/migration_database_helper.rb
|
351
351
|
- test/dummy/tmp/generators/app/models/azpire/v1/human_resource/user.rb
|
352
|
-
- test/dummy/tmp/generators/app/models/mang.rb
|
353
352
|
- test/dummy/tmp/generators/config/initializers/devise_jwt_auth.rb
|
354
|
-
- test/dummy/tmp/generators/
|
355
|
-
- test/dummy/tmp/generators/db/migrate/20200209225557_devise_jwt_auth_create_azpire_v1_human_resource_users.rb
|
356
|
-
- test/dummy/tmp/generators/db/migrate/20200209225557_devise_jwt_auth_create_mangs.rb
|
353
|
+
- test/dummy/tmp/generators/db/migrate/20200210193225_devise_jwt_auth_create_azpire_v1_human_resource_users.rb
|
357
354
|
- test/factories/users.rb
|
358
355
|
- test/lib/devise_jwt_auth/blacklist_test.rb
|
359
356
|
- test/lib/devise_jwt_auth/token_factory_test.rb
|
@@ -408,12 +405,9 @@ test_files:
|
|
408
405
|
- test/test_helper.rb
|
409
406
|
- test/dummy/lib/migration_database_helper.rb
|
410
407
|
- test/dummy/config.ru
|
411
|
-
- test/dummy/tmp/generators/db/migrate/
|
412
|
-
- test/dummy/tmp/generators/db/migrate/20200209225557_devise_jwt_auth_create_mangs.rb
|
413
|
-
- test/dummy/tmp/generators/config/routes.rb
|
408
|
+
- test/dummy/tmp/generators/db/migrate/20200210193225_devise_jwt_auth_create_azpire_v1_human_resource_users.rb
|
414
409
|
- test/dummy/tmp/generators/config/initializers/devise_jwt_auth.rb
|
415
410
|
- test/dummy/tmp/generators/app/models/azpire/v1/human_resource/user.rb
|
416
|
-
- test/dummy/tmp/generators/app/models/mang.rb
|
417
411
|
- test/dummy/db/migrate/20150708104536_devise_jwt_auth_create_unconfirmable_users.rb
|
418
412
|
- test/dummy/db/migrate/20140916224624_add_favorite_color_to_mangs.rb
|
419
413
|
- test/dummy/db/migrate/20140829044006_add_operating_thetan_to_user.rb
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Mang < ActiveRecord::Base
|
4
|
-
# Include default devise modules. Others available are:
|
5
|
-
# :confirmable, :lockable, :timeoutable and :omniauthable
|
6
|
-
devise :database_authenticatable, :registerable,
|
7
|
-
:recoverable, :rememberable, :trackable, :validatable
|
8
|
-
include DeviseJwtAuth::Concerns::User
|
9
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class DeviseJwtAuthCreateMangs < ActiveRecord::Migration[6.0]
|
4
|
-
def change
|
5
|
-
|
6
|
-
create_table(:mangs) do |t|
|
7
|
-
## Required
|
8
|
-
t.string :provider, null: false, default: 'email'
|
9
|
-
t.string :uid, null: false, default: ''
|
10
|
-
|
11
|
-
## Database authenticatable
|
12
|
-
t.string :encrypted_password, null: false, default: ''
|
13
|
-
|
14
|
-
## Recoverable
|
15
|
-
t.string :reset_password_token
|
16
|
-
t.datetime :reset_password_sent_at
|
17
|
-
t.boolean :allow_password_change, default: false
|
18
|
-
|
19
|
-
## Rememberable
|
20
|
-
t.datetime :remember_created_at
|
21
|
-
|
22
|
-
## Confirmable
|
23
|
-
t.string :confirmation_token
|
24
|
-
t.datetime :confirmed_at
|
25
|
-
t.datetime :confirmation_sent_at
|
26
|
-
t.string :unconfirmed_email # Only if using reconfirmable
|
27
|
-
|
28
|
-
## Lockable
|
29
|
-
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
30
|
-
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
31
|
-
# t.datetime :locked_at
|
32
|
-
|
33
|
-
## User Info
|
34
|
-
t.string :name
|
35
|
-
t.string :nickname
|
36
|
-
t.string :image
|
37
|
-
t.string :email
|
38
|
-
|
39
|
-
## Tokens
|
40
|
-
t.text :tokens
|
41
|
-
|
42
|
-
t.timestamps
|
43
|
-
end
|
44
|
-
|
45
|
-
add_index :mangs, :email, unique: true
|
46
|
-
add_index :mangs, [:uid, :provider], unique: true
|
47
|
-
add_index :mangs, :reset_password_token, unique: true
|
48
|
-
add_index :mangs, :confirmation_token, unique: true
|
49
|
-
# add_index :mangs, :unlock_token, unique: true
|
50
|
-
end
|
51
|
-
end
|