devise-otp 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40f03e3fee5939da23d1f583390f794a2e4e456a08fd311d53a605e94ba77075
4
- data.tar.gz: cc3e95dcebf0186cbb7a5f3552184093dc6e2209e421b359c6384f788f8ccaed
3
+ metadata.gz: 40ba57c939a2a84a81a014b151a2ea0fe37a4253942df15a703a0fd83aa9e80c
4
+ data.tar.gz: bba9a1e8d78ea6760c9c32ed643c05ed9138635095c0f9a16451f6a9922bfeba
5
5
  SHA512:
6
- metadata.gz: a62beac8100a3f98a60b6b19f279d795d1f942dc0b44b5d7ad345527b315363185439630b3df7e34dce8d0c0bb154329b882965f45cabbb50ff1a93c7c7cdb09
7
- data.tar.gz: 651d1dc15b3444db54eb8e2d14d6273858d2ec66ac7feee0ce314085175d5d3722f7062e914979b2b05a647ba8470a873179d962aadcb0657bcf8bd9bd814c66
6
+ metadata.gz: 79f30180843989aed3f784e8d775d8d86a206a328f3032b7f202815e1f590fcc5d3bf3d65cccc20731af5d1de227dd2d857111432fc21ad305524a402219f91a
7
+ data.tar.gz: 905e257c92ef4cad86876a2e37ec46cea614dafc715ebff364e58c580f7ab1528181771ff96534e5e61978168840f4a9820729b9d819f4c7c002ec970de81da5
data/README.md CHANGED
@@ -15,6 +15,10 @@ Some of the compatible token devices are:
15
15
 
16
16
  Device OTP was recently updated to work with Rails 7 and Turbo.
17
17
 
18
+ ## Sponsor
19
+
20
+ Devise::OTP development is sponsored by [Business Class](https://businessclasskit.com/) Rails SaaS starter kit. If you don't want to setup OTP yourself for your new project, consider starting one on Business Class.
21
+
18
22
  ## Two-factors authentication using OTP
19
23
 
20
24
  * A shared secret is generated on the server, and stored both on the token device (e.g. the phone) and the server itself.
@@ -80,8 +80,6 @@ module DeviseOtp
80
80
 
81
81
  def done_valid_refresh
82
82
  otp_refresh_credentials_for(resource)
83
- otp_set_flash_message :success, :valid_refresh if is_navigational_format?
84
-
85
83
  respond_with resource, location: otp_fetch_refresh_return_url
86
84
  end
87
85
 
data/devise-otp.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.files = `git ls-files`.split($/)
15
15
  gem.require_paths = ["lib"]
16
16
 
17
- gem.add_runtime_dependency "rails", ">= 7.0", "< 7.2"
17
+ gem.add_runtime_dependency "rails", ">= 6.1", "< 7.2"
18
18
  gem.add_runtime_dependency "devise", ">= 4.8.0", "< 5.0"
19
19
  gem.add_runtime_dependency "rotp", ">= 2.0.0"
20
20
 
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module OTP
3
- VERSION = "0.5.0"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
@@ -18,6 +18,7 @@ module DeviseOtpAuthenticatable::Hooks
18
18
 
19
19
  otp_refresh_credentials_for(resource)
20
20
 
21
+ yield resource if block_given?
21
22
  if otp_challenge_required_on?(resource)
22
23
  challenge = resource.generate_otp_challenge!
23
24
  warden.logout
@@ -48,7 +49,7 @@ module DeviseOtpAuthenticatable::Hooks
48
49
  # the resource -should- have otp turned on, but it isn't
49
50
  #
50
51
  def otp_mandatory_on?(resource)
51
- return true if resource.class.otp_mandatory
52
+ return true if resource.class.otp_mandatory && !resource.otp_enabled
52
53
  return false unless resource.respond_to?(:otp_mandatory)
53
54
 
54
55
  resource.otp_mandatory && !resource.otp_enabled
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-otp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lele Forzani
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-18 00:00:00.000000000 Z
12
+ date: 2023-07-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -17,7 +17,7 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '7.0'
20
+ version: '6.1'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
23
  version: '7.2'
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: '7.0'
30
+ version: '6.1'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '7.2'