quo_vadis 2.1.9 → 2.1.11

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: 3776f82ebb4987586131a44692de5891ec821e7e82a1de249fc3d8905ef551d8
4
- data.tar.gz: 6914f2e05d50ffbd9451d6e50484674d7bb775d2d871922749cc4be1553e35a6
3
+ metadata.gz: 75eaf7f87a444de55a110ed4dd37d5fa14ad1c0d2d51bae7b0e3eb549681578b
4
+ data.tar.gz: c79cbcd1d629bcfb6bd4b95f6b77e95617173bfb5f649d73c493f26f53635c2b
5
5
  SHA512:
6
- metadata.gz: 5229c567fe09a76fad025b0dea0fc36192defd24e04077374816cfb99414b6a9cc3213e8410f5ee23fedb297d1b157d64345c317d646d1226655c5e60e50c1ac
7
- data.tar.gz: 0ace7c8c5c1075eec8a54aa31ba01564a8a9ff0fec23387650a00a1721affca7c9326e083ac9f26a8afdd04bee6f6e8a748ae1c9bbf5b4e9d3b005804362afe6
6
+ metadata.gz: 0c79e6e5844e6ff1292d49beabf8728a086c7460726244b9452c5d77d1d1bc32b1aca11217345e0da8ce89e6c15c8bbb2baece066033e796bce119b7757f3c09
7
+ data.tar.gz: 073ba2aae8cd45f600ffa2d58e8b5e6ae0889a7fa976dd58447132c11993fbd5f0ba16c419eba7bcb55fedcdfb21ec1f2f01a9c94c532f7c1460588958dcae0b
data/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@
4
4
  ## HEAD
5
5
 
6
6
 
7
+ ## 2.1.11 (14 September 2022)
8
+
9
+ * Introduce common controller superclass.
10
+
11
+
12
+ ## 2.1.10 (14 September 2022)
13
+
14
+ * Enable configuration of mailer superclass.
15
+
16
+
7
17
  ## 2.1.9 (13 September 2022)
8
18
 
9
19
  * Enable code to be run after sign up.
data/README.md CHANGED
@@ -466,6 +466,10 @@ __`account_confirmation_token_lifetime`__ (`ActiveSupport::Duration` | integer)
466
466
 
467
467
  The `Duration` or number of seconds for which an account-confirmation token is valid.
468
468
 
469
+ __`mailer_superclass`__ (string)
470
+
471
+ The class from which QuoVadis's mailer inherits.
472
+
469
473
  __`mail_headers`__ (hash)
470
474
 
471
475
  Mail headers which QuoVadis' emails should have.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuoVadis
4
- class ConfirmationsController < ApplicationController
4
+ class ConfirmationsController < QuoVadisController
5
5
 
6
6
  # holding page
7
7
  def index
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuoVadis
4
- class LogsController < ApplicationController
4
+ class LogsController < QuoVadisController
5
5
  before_action :require_password_authentication
6
6
 
7
7
  PER_PAGE = 25
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuoVadis
4
- class PasswordResetsController < ApplicationController
4
+ class PasswordResetsController < QuoVadisController
5
5
 
6
6
  # holding page for after the create action
7
7
  def index
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuoVadis
4
- class PasswordsController < ApplicationController
4
+ class PasswordsController < QuoVadisController
5
5
 
6
6
  before_action :require_authentication
7
7
 
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module QuoVadis
4
+ class QuoVadisController < ApplicationController
5
+ end
6
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuoVadis
4
- class RecoveryCodesController < ApplicationController
4
+ class RecoveryCodesController < QuoVadisController
5
5
  before_action :require_password_authentication
6
6
 
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuoVadis
4
- class SessionsController < ApplicationController
4
+ class SessionsController < QuoVadisController
5
5
 
6
6
  # Don't require authentication for the :destroy action so that someone
7
7
  # who has logged in via password but not completed 2fa can still log out.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuoVadis
4
- class TotpsController < ApplicationController
4
+ class TotpsController < QuoVadisController
5
5
  before_action :require_password_authentication
6
6
 
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuoVadis
4
- class TwofasController < ApplicationController
4
+ class TwofasController < QuoVadisController
5
5
  before_action :require_password_authentication
6
6
 
7
7
  def show
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuoVadis
4
- class Mailer < ::ActionMailer::Base
4
+ class Mailer < QuoVadis.mailer_superclass.constantize
5
5
 
6
6
  def reset_password
7
7
  @url = params[:url]
@@ -10,6 +10,7 @@ QuoVadis.configure do
10
10
  password_reset_token_lifetime 10.minutes
11
11
  accounts_require_confirmation false
12
12
  account_confirmation_token_lifetime 10.minutes
13
+ mailer_superclass 'ApplicationMailer'
13
14
  mail_headers ({ from: 'Example App <support@example.com>' })
14
15
  enqueue_transactional_emails true
15
16
  app_name Rails.app_class.to_s.deconstantize # for the TOTP QR code
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuoVadis
4
- VERSION = '2.1.9'
4
+ VERSION = '2.1.11'
5
5
  end
data/lib/quo_vadis.rb CHANGED
@@ -25,6 +25,7 @@ module QuoVadis
25
25
  :session_lifetime_extend_to_end_of_day,# true | false
26
26
  :session_idle_timeout, # :lifetime | ActiveSupport::Duration | [integer] seconds
27
27
  :password_reset_token_lifetime, # ActiveSupport::Duration | [integer] seconds
28
+ :mailer_superclass, # string
28
29
  :mail_headers, # hash
29
30
  :accounts_require_confirmation, # true | false
30
31
  :account_confirmation_token_lifetime, # ActiveSupport::Duration | [integer] seconds
@@ -0,0 +1,2 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quo_vadis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-13 00:00:00.000000000 Z
11
+ date: 2022-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -83,6 +83,7 @@ files:
83
83
  - app/controllers/quo_vadis/logs_controller.rb
84
84
  - app/controllers/quo_vadis/password_resets_controller.rb
85
85
  - app/controllers/quo_vadis/passwords_controller.rb
86
+ - app/controllers/quo_vadis/quo_vadis_controller.rb
86
87
  - app/controllers/quo_vadis/recovery_codes_controller.rb
87
88
  - app/controllers/quo_vadis/sessions_controller.rb
88
89
  - app/controllers/quo_vadis/totps_controller.rb
@@ -148,6 +149,7 @@ files:
148
149
  - test/dummy/app/controllers/articles_controller.rb
149
150
  - test/dummy/app/controllers/sign_ups_controller.rb
150
151
  - test/dummy/app/controllers/users_controller.rb
152
+ - test/dummy/app/mailers/application_mailer.rb
151
153
  - test/dummy/app/models/application_record.rb
152
154
  - test/dummy/app/models/article.rb
153
155
  - test/dummy/app/models/person.rb