devise_jwt_auth 0.1.3 → 0.1.4

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: 7330fe7fcd262dea525c6716fdee30c1c2f1361e00b708a4b848281350555fd4
4
- data.tar.gz: 01f87c1814dbcd8d51fe800ebb091941a9e0d0b768e40b14a784d7c546ba3acc
3
+ metadata.gz: 7477d1f078d762ffca1b359a0b487d33816238f9cde0567a9e35731eb323b65e
4
+ data.tar.gz: ebed2ca767f26b34ccae1cde42ec8c62352f3cbb14a11e2f3f6c2566217b0ee5
5
5
  SHA512:
6
- metadata.gz: 4e729775d51fa3e5c7871c2d0d9d56d5efd88a42d8dbbc72af572c7953e64d184eab735103da2f2fbb869bb329de120041010f2e4c2bb05f04e32821ad8b555b
7
- data.tar.gz: e942baa694e185efa7bf1a5ccfc9e462a28a636dbbc61f768c13baa7cb81332582fdd398c159e56132d6f970c8375f64caddab467dc9a1a38abe2952c29fe47b
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
- # include DeviseJwtAuth::Concerns::SetUserByToken
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,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module DeviseJwtAuth::Concerns::SetUserByJwtToken
3
+ module DeviseJwtAuth::Concerns::SetUserByToken
4
4
  extend ActiveSupport::Concern
5
5
  include DeviseJwtAuth::Concerns::ResourceFinder
6
6
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeviseJwtAuth
4
- VERSION = '0.1.3'.freeze
4
+ VERSION = '0.1.4'.freeze
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ApplicationController < ActionController::Base
4
- include DeviseJwtAuth::Concerns::SetUserByJwtToken
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
- # self.send_new_access_token_on_each_request = false
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
- # self.refresh_token_lifespan = 2.weeks
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
- # self.access_token_lifespan = 15.minutes
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
- # self.refresh_token_name = 'refresh-token'
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
- # self.access_token_name = 'access-token'
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
- self.refresh_token_encryption_key = 'your-refresh-token-secret-key-here'
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
- self.access_token_encryption_key = 'your-access-token-secret-key-here'
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
- # self.default_confirm_success_url = nil
68
- # self.default_password_reset_url = nil
69
- # self.redirect_whitelist = nil
70
- # self.update_token_version_after_password_reset = true
71
- # self.bypass_sign_in = true
72
- # self.require_client_password_reset_token = false
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
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.3
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/set_user_by_jwt_token.rb
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/config/routes.rb
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/20200209225557_devise_jwt_auth_create_azpire_v1_human_resource_users.rb
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,9 +0,0 @@
1
- Rails.application.routes.draw do
2
- mount_devise_jwt_auth_for 'Azpire::V1::HumanResource::User', at: 'auth'
3
-
4
- mount_devise_jwt_auth_for 'Mang', at: 'mangs'
5
- as :mang do
6
- # Define routes for Mang within this block.
7
- end
8
- patch '/chong', to: 'bong#index'
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