devise_code_authenticatable 0.2.3 → 0.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 802cb621d38b1a1a2d105a2fb1861d33a6ccf86f1cdff22a160f7bf7b0263d8a
|
4
|
+
data.tar.gz: 2b84e12d2ca615676d14959a302c9237b5261a564e6b3680c8af6fdfc339e4d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 242ca71ae2d6038956c38b7874c027a9b1e8ecb34deb4e7f14cea470eead8b1e34679e99f3d587824df16546b9085f0c4688f97092a6749ff4119ae41e7d86fb
|
7
|
+
data.tar.gz: 361444707ec37d0c5780f8d5f2081baa33f3064b4d8c46010431b5886b15fc87fa0e09e30b672746e925461e304cbcfa318c0f4f76d82f71b88aa7cdd24f6308
|
@@ -1,11 +1,10 @@
|
|
1
1
|
class Devise::LoginCodesController < DeviseController
|
2
2
|
prepend_before_action :allow_params_authentication!, only: :verify
|
3
3
|
|
4
|
-
def verify
|
5
|
-
self.resource = warden.authenticate!(auth_options)
|
4
|
+
def verify(&block)
|
5
|
+
self.resource = warden.authenticate!(auth_options, &block)
|
6
6
|
set_flash_message!(:notice, :signed_in)
|
7
7
|
sign_in(resource_name, resource)
|
8
|
-
yield resource if block_given?
|
9
8
|
respond_with resource, location: after_sign_in_path_for(resource)
|
10
9
|
end
|
11
10
|
|
@@ -14,17 +14,17 @@ module DeviseCodeAuthenticatable
|
|
14
14
|
end
|
15
15
|
|
16
16
|
if resource.login_codes.empty?
|
17
|
-
resource.send_code_login_instructions
|
18
17
|
fail(:login_code_expired); return
|
19
18
|
end
|
20
19
|
|
21
20
|
if resource.login_codes.last.expired?
|
22
|
-
resource.
|
21
|
+
resource.expire_all_login_codes
|
23
22
|
fail(:login_code_expired); return
|
24
23
|
end
|
25
24
|
|
26
25
|
if validate(resource){ hashed = true; resource.login_codes.last.verify(login_code) }
|
27
26
|
remember_me(resource)
|
27
|
+
yield resource if block_given?
|
28
28
|
resource.after_code_authentication
|
29
29
|
success!(resource)
|
30
30
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_code_authenticatable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vincentying15
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Devise plugin to allow sign in by email sent code
|
14
14
|
email:
|
@@ -50,7 +50,7 @@ licenses:
|
|
50
50
|
metadata:
|
51
51
|
allowed_push_host: https://rubygems.org
|
52
52
|
source_code_uri: https://github.com/vincentying15/devise_code_authenticatable
|
53
|
-
post_install_message:
|
53
|
+
post_install_message:
|
54
54
|
rdoc_options: []
|
55
55
|
require_paths:
|
56
56
|
- lib
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|
68
68
|
rubygems_version: 3.1.6
|
69
|
-
signing_key:
|
69
|
+
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: devise_code_authenticatable
|
72
72
|
test_files: []
|