devise_token_auth 1.2.2 → 1.2.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: 135b5088d17b20d187a6ffe314356dd2a2474d9bd98898bc9e36bc931e6c9fef
4
- data.tar.gz: cf3c3c6fc19564248bdcb22e3b99624bd25a027383649a45c7e7bf1fddfd5bbd
3
+ metadata.gz: 97cef374b6bf1c601eb17d7c688bc4cb2547861ec98bc22f54efe0c526ab4be9
4
+ data.tar.gz: de18c9834d8c86cbf32afc51b4eeebc9bd1d80796e1f6c9c251e0b0c4c92f576
5
5
  SHA512:
6
- metadata.gz: 5f6e88376261bcea31e98d8af66cc298755d2cbc2724c481a100d78273824b1dcfcc016bbc2af2b43d1dcac945fc6a4015d351f321da9a432ec4c5129f8c58f0
7
- data.tar.gz: bde72417d1882c6f69076d3bfe8cebd077e39a681898fb0c5603643770a3d81eb0ac3d42dd46f8ae27aff4dae74a138159160974c1996ef4e28d252baf6b52ba
6
+ metadata.gz: 33817ddc37df1b92e4f21f5d5327100f54a2de0336ff85d0226c475a7115c7625b2fe8f10b33015d905784f66706e374e9a8c476f2965a7f6cdbb3a8fe159049
7
+ data.tar.gz: c8959019550a6a31253780c89405cc3fb2db56433f25336bfefc1bc266e3b46b075dfab96c3a6de5495dc13ff79cc7b6c5e42a58553b03c6347dd98c0fe6c0c2
data/README.md CHANGED
@@ -70,12 +70,8 @@ We have some bounties for some issues, [check them out](https://github.com/lynnd
70
70
 
71
71
  ## Live Demos
72
72
 
73
- [Here is a demo](http://ng-token-auth-demo.herokuapp.com/) of this app running with the [ng-token-auth](https://github.com/lynndylanhurley/ng-token-auth) module and [AngularJS](https://github.com/angular/angular.js).
74
-
75
73
  [Here is a demo](https://stackblitz.com/github/neroniaky/angular-token) of this app running with the [Angular-Token](https://github.com/neroniaky/angular-token) service and [Angular](https://github.com/angular/angular).
76
74
 
77
- [Here is a demo](https://j-toker-demo.herokuapp.com/) of this app using the [jToker](https://github.com/lynndylanhurley/j-toker) plugin and [React](http://facebook.github.io/react/).
78
-
79
75
  The fully configured api used in these demos can be found [here](https://github.com/lynndylanhurley/devise_token_auth_demo).
80
76
 
81
77
 
@@ -27,7 +27,7 @@ module DeviseTokenAuth
27
27
  redirect_to(redirect_to_link, redirect_options)
28
28
  else
29
29
  if redirect_url
30
- redirect_to DeviseTokenAuth::Url.generate(redirect_url, account_confirmation_success: false)
30
+ redirect_to DeviseTokenAuth::Url.generate(redirect_url, account_confirmation_success: false), redirect_options
31
31
  else
32
32
  raise ActionController::RoutingError, 'Not Found'
33
33
  end
@@ -2,7 +2,11 @@ module DeviseTokenAuth::Concerns::ActiveRecordSupport
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- serialize :tokens, DeviseTokenAuth::Concerns::TokensSerialization
5
+ if Rails.gem_version >= Gem::Version.new("7.1.0.a")
6
+ serialize :tokens, coder: DeviseTokenAuth::Concerns::TokensSerialization
7
+ else
8
+ serialize :tokens, DeviseTokenAuth::Concerns::TokensSerialization
9
+ end
6
10
  end
7
11
 
8
12
  class_methods do
@@ -0,0 +1,60 @@
1
+ fa:
2
+ devise_token_auth:
3
+ sessions:
4
+ not_confirmed: "یک ایمیل تأیید به حساب شما در '%{email}' ارسال شده است. شما باید دستورالعمل‌های موجود در ایمیل را دنبال کنید تا حساب شما فعال شود."
5
+ bad_credentials: "اطلاعات ورود نامعتبر است. لطفاً دوباره تلاش کنید."
6
+ not_supported: "برای ورود از POST /sign_in استفاده کنید. GET پشتیبانی نمی‌شود."
7
+ user_not_found: "کاربر پیدا نشد یا وارد نشده است."
8
+ token_validations:
9
+ invalid: "اطلاعات ورود نامعتبر است."
10
+ registrations:
11
+ missing_confirm_success_url: "پارامتر 'confirm_success_url' موجود نیست."
12
+ redirect_url_not_allowed: "انتقال به '%{redirect_url}' مجاز نیست."
13
+ email_already_exists: "یک حساب برای '%{email}' قبلاً وجود دارد."
14
+ account_with_uid_destroyed: "حساب با UID '%{uid}' حذف شده است."
15
+ account_to_destroy_not_found: "نمی‌توان حساب را برای حذف پیدا کرد."
16
+ user_not_found: "کاربر پیدا نشد."
17
+ omniauth:
18
+ not_allowed_redirect_url: "انتقال به '%{redirect_url}' مجاز نیست."
19
+ passwords:
20
+ missing_email: "شما باید یک آدرس ایمیل ارائه دهید."
21
+ missing_redirect_url: "آدرس انتقال موجود نیست."
22
+ not_allowed_redirect_url: "انتقال به '%{redirect_url}' مجاز نیست."
23
+ sended: "یک ایمیل به '%{email}' ارسال شده است که شامل دستورالعمل‌های بازنشانی رمز عبور شما است."
24
+ sended_paranoid: "اگر آدرس ایمیل شما در پایگاه داده ما وجود داشته باشد، در چند دقیقه یک لینک بازیابی رمز عبور به آدرس ایمیل شما ارسال خواهد شد."
25
+ user_not_found: "نمی‌توان کاربری با ایمیل '%{email}' پیدا کرد."
26
+ password_not_required: "این حساب نیازی به رمز عبور ندارد. به جای آن با حساب '%{provider}' خود وارد شوید."
27
+ missing_passwords: "شما باید فیلدهای 'رمز عبور' و 'تأیید رمز عبور' را پر کنید."
28
+ successfully_updated: "رمز عبور شما با موفقیت به‌روزرسانی شد."
29
+ unlocks:
30
+ missing_email: "شما باید یک آدرس ایمیل ارائه دهید."
31
+ sended: "یک ایمیل به '%{email}' ارسال شده است که شامل دستورالعمل‌های باز کردن حساب شما است."
32
+ sended_paranoid: "اگر حساب شما وجود داشته باشد، در چند دقیقه یک ایمیل با دستورالعمل‌های باز کردن حساب شما ارسال خواهد شد."
33
+ user_not_found: "نمی‌توان کاربری با ایمیل '%{email}' پیدا کرد."
34
+ confirmations:
35
+ sended: "یک ایمیل به '%{email}' ارسال شده است که شامل دستورالعمل‌های تأیید حساب شما است."
36
+ sended_paranoid: "اگر آدرس ایمیل شما در پایگاه داده ما وجود داشته باشد، در چند دقیقه یک ایمیل با دستورالعمل‌های تأیید آدرس ایمیل شما ارسال خواهد شد."
37
+ user_not_found: "نمی‌توان کاربری با ایمیل '%{email}' پیدا کرد."
38
+ missing_email: "شما باید یک آدرس ایمیل ارائه دهید."
39
+
40
+ errors:
41
+ messages:
42
+ validate_sign_up_params: "لطفاً داده‌های صحیح ثبت نام را در بدنه درخواست ارسال کنید."
43
+ validate_account_update_params: "لطفاً داده‌های صحیح به‌روزرسانی حساب را در بدنه درخواست ارسال کنید."
44
+ not_email: "یک ایمیل نیست"
45
+ devise:
46
+ mailer:
47
+ confirmation_instructions:
48
+ confirm_link_msg: "شما می‌توانید ایمیل حساب خود را از طریق لینک زیر تأیید کنید:"
49
+ confirm_account_link: "تأیید حساب من"
50
+ reset_password_instructions:
51
+ request_reset_link_msg: "شخصی درخواست یک لینک برای تغییر رمز عبور شما کرده است. شما می‌توانید این کار را از طریق لینک زیر انجام دهید."
52
+ password_change_link: "تغییر رمز عبور من"
53
+ ignore_mail_msg: "اگر شما این درخواست را نکرده‌اید، لطفاً این ایمیل را نادیده بگیرید."
54
+ no_changes_msg: "رمز عبور شما تغییر نخواهد کرد تا زمانی که به لینک بالا دسترسی پیدا کنید و یک رمز عبور جدید ایجاد کنید."
55
+ unlock_instructions:
56
+ account_lock_msg: "حساب شما به دلیل تعداد زیادی تلاش ناموفق برای ورود قفل شده است."
57
+ unlock_link_msg: "برای باز کردن حساب خود، روی لینک زیر کلیک کنید:"
58
+ unlock_link: "باز کردن حساب من"
59
+ hello: "سلام"
60
+ welcome: "خوش آمدید"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeviseTokenAuth
4
- VERSION = '1.2.2'.freeze
4
+ VERSION = '1.2.4'.freeze
5
5
  end
@@ -13,7 +13,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
13
13
 
14
14
  def mock_registration_params
15
15
  {
16
- email: Faker::Internet.email,
16
+ email: Faker::Internet.unique.email,
17
17
  password: 'secret123',
18
18
  password_confirmation: 'secret123',
19
19
  confirm_success_url: Faker::Internet.url,
@@ -152,7 +152,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
152
152
 
153
153
  test 'request to whitelisted redirect should be successful' do
154
154
  post '/auth',
155
- params: { email: Faker::Internet.email,
155
+ params: { email: Faker::Internet.unique.email,
156
156
  password: 'secret123',
157
157
  password_confirmation: 'secret123',
158
158
  confirm_success_url: @good_redirect_url,
@@ -163,7 +163,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
163
163
 
164
164
  test 'request to non-whitelisted redirect should fail' do
165
165
  post '/auth',
166
- params: { email: Faker::Internet.email,
166
+ params: { email: Faker::Internet.unique.email,
167
167
  password: 'secret123',
168
168
  password_confirmation: 'secret123',
169
169
  confirm_success_url: @bad_redirect_url,
@@ -181,7 +181,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
181
181
  describe 'failure if not redirecturl' do
182
182
  test 'request should fail if not redirect_url' do
183
183
  post '/auth',
184
- params: { email: Faker::Internet.email,
184
+ params: { email: Faker::Internet.unique.email,
185
185
  password: 'secret123',
186
186
  password_confirmation: 'secret123',
187
187
  unpermitted_param: '(x_x)' }
@@ -191,7 +191,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
191
191
 
192
192
  test 'request to non-whitelisted redirect should fail' do
193
193
  post '/auth',
194
- params: { email: Faker::Internet.email,
194
+ params: { email: Faker::Internet.unique.email,
195
195
  password: 'secret123',
196
196
  password_confirmation: 'secret123',
197
197
  unpermitted_param: '(x_x)' }
@@ -210,7 +210,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
210
210
  DeviseTokenAuth.default_confirm_success_url = @redirect_url
211
211
 
212
212
  assert_difference 'ActionMailer::Base.deliveries.size', 1 do
213
- post '/auth', params: { email: Faker::Internet.email,
213
+ post '/auth', params: { email: Faker::Internet.unique.email,
214
214
  password: 'secret123',
215
215
  password_confirmation: 'secret123',
216
216
  unpermitted_param: '(x_x)' }
@@ -240,7 +240,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
240
240
  @mails_sent = ActionMailer::Base.deliveries.count
241
241
 
242
242
  post '/api/v1/auth', params: {
243
- email: Faker::Internet.email,
243
+ email: Faker::Internet.unique.email,
244
244
  password: 'secret123',
245
245
  password_confirmation: 'secret123',
246
246
  confirm_success_url: Faker::Internet.url,
@@ -295,7 +295,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
295
295
  @operating_thetan = 2
296
296
 
297
297
  post '/auth',
298
- params: { email: Faker::Internet.email,
298
+ params: { email: Faker::Internet.unique.email,
299
299
  password: 'secret123',
300
300
  password_confirmation: 'secret123',
301
301
  confirm_success_url: @redirect_url,
@@ -388,7 +388,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
388
388
  describe 'Mismatched passwords' do
389
389
  before do
390
390
  post '/auth',
391
- params: { email: Faker::Internet.email,
391
+ params: { email: Faker::Internet.unique.email,
392
392
  password: 'secret123',
393
393
  password_confirmation: 'bogus',
394
394
  confirm_success_url: Faker::Internet.url }
@@ -505,7 +505,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
505
505
  # test valid update param
506
506
  @resource_class = User
507
507
  @new_operating_thetan = 1_000_000
508
- @email = Faker::Internet.safe_email
508
+ @email = Faker::Internet.unique.email
509
509
  @request_params = {
510
510
  operating_thetan: @new_operating_thetan,
511
511
  email: @email
@@ -612,7 +612,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
612
612
  # test valid update param
613
613
  @resource_class = User
614
614
  @new_operating_thetan = 1_000_000
615
- @email = Faker::Internet.safe_email
615
+ @email = Faker::Internet.unique.email
616
616
  @request_params = {
617
617
  operating_thetan: @new_operating_thetan,
618
618
  email: @email
@@ -663,7 +663,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
663
663
  before do
664
664
  DeviseTokenAuth.check_current_password_before_update = :password
665
665
  @new_operating_thetan = 1_000_000
666
- @email = Faker::Internet.safe_email
666
+ @email = Faker::Internet.unique.email
667
667
  end
668
668
 
669
669
  after do
@@ -773,7 +773,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
773
773
  describe 'Alternate user class' do
774
774
  before do
775
775
  post '/mangs',
776
- params: { email: Faker::Internet.email,
776
+ params: { email: Faker::Internet.unique.email,
777
777
  password: 'secret123',
778
778
  password_confirmation: 'secret123',
779
779
  confirm_success_url: Faker::Internet.url }
@@ -814,7 +814,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
814
814
  @config_name = 'altUser'
815
815
 
816
816
  post '/mangs',
817
- params: { email: Faker::Internet.email,
817
+ params: { email: Faker::Internet.unique.email,
818
818
  password: 'secret123',
819
819
  password_confirmation: 'secret123',
820
820
  confirm_success_url: Faker::Internet.url,
@@ -840,7 +840,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
840
840
  test 'UnregisterableUser should not be able to access registration routes' do
841
841
  assert_raises(ActionController::RoutingError) do
842
842
  post '/unregisterable_user_auth',
843
- params: { email: Faker::Internet.email,
843
+ params: { email: Faker::Internet.unique.email,
844
844
  password: 'secret123',
845
845
  password_confirmation: 'secret123',
846
846
  confirm_success_url: Faker::Internet.url }
@@ -853,7 +853,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
853
853
  User.set_callback(:create, :before, :skip_confirmation!)
854
854
 
855
855
  post '/auth',
856
- params: { email: Faker::Internet.email,
856
+ params: { email: Faker::Internet.unique.email,
857
857
  password: 'secret123',
858
858
  password_confirmation: 'secret123',
859
859
  confirm_success_url: Faker::Internet.url }
@@ -893,7 +893,7 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
893
893
  @mails_sent = ActionMailer::Base.deliveries.count
894
894
 
895
895
  post '/only_email_auth',
896
- params: { email: Faker::Internet.email,
896
+ params: { email: Faker::Internet.unique.email,
897
897
  password: 'secret123',
898
898
  password_confirmation: 'secret123',
899
899
  confirm_success_url: Faker::Internet.url,
@@ -420,7 +420,7 @@ class DeviseTokenAuth::SessionsControllerTest < ActionController::TestCase
420
420
  describe 'With paranoid mode' do
421
421
  before do
422
422
  mock_hash = '$2a$04$MUWADkfA6MHXDdWHoep6QOvX1o0Y56pNqt3NMWQ9zCRwKSp1HZJba'
423
- @bcrypt_mock = MiniTest::Mock.new
423
+ @bcrypt_mock = Minitest::Mock.new
424
424
  @bcrypt_mock.expect(:call, mock_hash, [Object, String])
425
425
 
426
426
  swap Devise, paranoid: true do
@@ -1,9 +1,11 @@
1
- # frozen_string_literal: true
1
+ class User < ApplicationRecord
2
+ # Include default devise modules.
3
+ devise :database_authenticatable, :registerable,
4
+ :recoverable, :rememberable, :trackable, :validatable,
5
+ :confirmable, :omniauthable
6
+ include DeviseTokenAuth::Concerns::User
2
7
 
3
- class User < ActiveRecord::Base
4
- # Include default devise modules. Others available are:
5
- # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
6
- devise :database_authenticatable, :registerable,
7
- :recoverable, :rememberable, :validatable
8
- include DeviseTokenAuth::Concerns::User
9
- end
8
+ def whatever
9
+ puts 'whatever'
10
+ end
11
+ end
@@ -1,7 +1,7 @@
1
1
  class DeviseTokenAuthCreateUsers < ActiveRecord::Migration[7.0]
2
2
  def change
3
3
 
4
- create_table(:users, id: :uuid) do |t|
4
+ create_table(:users) do |t|
5
5
  ## Required
6
6
  t.string :provider, :null => false, :default => "email"
7
7
  t.string :uid, :null => false, :default => ""
@@ -1,6 +1,6 @@
1
1
  FactoryBot.define do
2
2
  factory :user do
3
- email { Faker::Internet.unique.safe_email }
3
+ email { Faker::Internet.unique.email }
4
4
  password { Faker::Internet.password }
5
5
  provider { 'email' }
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_token_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lynn Hurley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-11 00:00:00.000000000 Z
11
+ date: 2024-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 4.2.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.1'
22
+ version: '7.3'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 4.2.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.1'
32
+ version: '7.3'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: devise
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -189,6 +189,7 @@ files:
189
189
  - config/locales/de.yml
190
190
  - config/locales/en.yml
191
191
  - config/locales/es.yml
192
+ - config/locales/fa.yml
192
193
  - config/locales/fr.yml
193
194
  - config/locales/he.yml
194
195
  - config/locales/it.yml
@@ -321,7 +322,7 @@ files:
321
322
  - test/dummy/lib/migration_database_helper.rb
322
323
  - test/dummy/tmp/generators/app/models/user.rb
323
324
  - test/dummy/tmp/generators/config/initializers/devise_token_auth.rb
324
- - test/dummy/tmp/generators/db/migrate/20230415183419_devise_token_auth_create_users.rb
325
+ - test/dummy/tmp/generators/db/migrate/20240519164408_devise_token_auth_create_users.rb
325
326
  - test/factories/users.rb
326
327
  - test/lib/devise_token_auth/blacklist_test.rb
327
328
  - test/lib/devise_token_auth/rails/custom_routes_test.rb
@@ -357,7 +358,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
357
358
  - !ruby/object:Gem::Version
358
359
  version: '0'
359
360
  requirements: []
360
- rubygems_version: 3.3.7
361
+ rubygems_version: 3.4.19
361
362
  signing_key:
362
363
  specification_version: 4
363
364
  summary: Token based authentication for rails. Uses Devise + OmniAuth.
@@ -456,7 +457,7 @@ test_files:
456
457
  - test/dummy/lib/migration_database_helper.rb
457
458
  - test/dummy/tmp/generators/app/models/user.rb
458
459
  - test/dummy/tmp/generators/config/initializers/devise_token_auth.rb
459
- - test/dummy/tmp/generators/db/migrate/20230415183419_devise_token_auth_create_users.rb
460
+ - test/dummy/tmp/generators/db/migrate/20240519164408_devise_token_auth_create_users.rb
460
461
  - test/factories/users.rb
461
462
  - test/lib/devise_token_auth/blacklist_test.rb
462
463
  - test/lib/devise_token_auth/rails/custom_routes_test.rb