rodauth 2.21.0 → 2.24.0
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 +4 -4
- data/CHANGELOG +36 -442
- data/README.rdoc +11 -3
- data/doc/base.rdoc +1 -0
- data/doc/guides/internals.rdoc +11 -0
- data/doc/guides/paths.rdoc +3 -0
- data/doc/login_password_requirements_base.rdoc +1 -1
- data/doc/otp.rdoc +1 -0
- data/doc/recovery_codes.rdoc +1 -0
- data/doc/release_notes/2.22.0.txt +43 -0
- data/doc/release_notes/2.23.0.txt +15 -0
- data/doc/release_notes/2.24.0.txt +15 -0
- data/doc/reset_password.rdoc +16 -16
- data/doc/reset_password_notify.rdoc +17 -0
- data/lib/rodauth/features/active_sessions.rb +3 -1
- data/lib/rodauth/features/base.rb +20 -2
- data/lib/rodauth/features/change_password_notify.rb +2 -22
- data/lib/rodauth/features/email_auth.rb +1 -16
- data/lib/rodauth/features/http_basic_auth.rb +1 -1
- data/lib/rodauth/features/internal_request.rb +1 -1
- data/lib/rodauth/features/json.rb +2 -4
- data/lib/rodauth/features/jwt_cors.rb +1 -1
- data/lib/rodauth/features/lockout.rb +2 -18
- data/lib/rodauth/features/otp.rb +8 -2
- data/lib/rodauth/features/recovery_codes.rb +6 -1
- data/lib/rodauth/features/remember.rb +1 -1
- data/lib/rodauth/features/reset_password.rb +5 -20
- data/lib/rodauth/features/reset_password_notify.rb +16 -0
- data/lib/rodauth/features/sms_codes.rb +2 -2
- data/lib/rodauth/features/verify_account.rb +3 -20
- data/lib/rodauth/version.rb +1 -1
- data/lib/rodauth.rb +27 -0
- data/templates/reset-password-notify-email.str +2 -0
- metadata +15 -5
data/lib/rodauth.rb
CHANGED
@@ -233,6 +233,33 @@ module Rodauth
|
|
233
233
|
end
|
234
234
|
end
|
235
235
|
|
236
|
+
def email(type, subject, opts = {})
|
237
|
+
subject_method = :"#{type}_email_subject"
|
238
|
+
body_method = :"#{type}_email_body"
|
239
|
+
create_method = :"create_#{type}_email"
|
240
|
+
send_method = :"send_#{type}_email"
|
241
|
+
|
242
|
+
translatable_method subject_method, subject
|
243
|
+
auth_methods create_method, send_method
|
244
|
+
|
245
|
+
body_template = "#{type.to_s.tr('_', '-')}-email"
|
246
|
+
if opts[:translatable]
|
247
|
+
auth_value_methods body_method
|
248
|
+
define_method(body_method){translate(body_method, render(body_template))}
|
249
|
+
else
|
250
|
+
auth_methods body_method
|
251
|
+
define_method(body_method){render(body_template)}
|
252
|
+
end
|
253
|
+
|
254
|
+
define_method(create_method) do
|
255
|
+
create_email(send(subject_method), send(body_method))
|
256
|
+
end
|
257
|
+
|
258
|
+
define_method(send_method) do
|
259
|
+
send_email(send(create_method))
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
236
263
|
def additional_form_tags(name=feature_name)
|
237
264
|
auth_value_method(:"#{name}_additional_form_tags", nil)
|
238
265
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rodauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -286,6 +286,7 @@ extra_rdoc_files:
|
|
286
286
|
- doc/recovery_codes.rdoc
|
287
287
|
- doc/remember.rdoc
|
288
288
|
- doc/reset_password.rdoc
|
289
|
+
- doc/reset_password_notify.rdoc
|
289
290
|
- doc/session_expiration.rdoc
|
290
291
|
- doc/single_session.rdoc
|
291
292
|
- doc/sms_codes.rdoc
|
@@ -336,6 +337,9 @@ extra_rdoc_files:
|
|
336
337
|
- doc/release_notes/2.2.0.txt
|
337
338
|
- doc/release_notes/2.20.0.txt
|
338
339
|
- doc/release_notes/2.21.0.txt
|
340
|
+
- doc/release_notes/2.22.0.txt
|
341
|
+
- doc/release_notes/2.23.0.txt
|
342
|
+
- doc/release_notes/2.24.0.txt
|
339
343
|
- doc/release_notes/2.3.0.txt
|
340
344
|
- doc/release_notes/2.4.0.txt
|
341
345
|
- doc/release_notes/2.5.0.txt
|
@@ -444,6 +448,9 @@ files:
|
|
444
448
|
- doc/release_notes/2.2.0.txt
|
445
449
|
- doc/release_notes/2.20.0.txt
|
446
450
|
- doc/release_notes/2.21.0.txt
|
451
|
+
- doc/release_notes/2.22.0.txt
|
452
|
+
- doc/release_notes/2.23.0.txt
|
453
|
+
- doc/release_notes/2.24.0.txt
|
447
454
|
- doc/release_notes/2.3.0.txt
|
448
455
|
- doc/release_notes/2.4.0.txt
|
449
456
|
- doc/release_notes/2.5.0.txt
|
@@ -453,6 +460,7 @@ files:
|
|
453
460
|
- doc/release_notes/2.9.0.txt
|
454
461
|
- doc/remember.rdoc
|
455
462
|
- doc/reset_password.rdoc
|
463
|
+
- doc/reset_password_notify.rdoc
|
456
464
|
- doc/session_expiration.rdoc
|
457
465
|
- doc/single_session.rdoc
|
458
466
|
- doc/sms_codes.rdoc
|
@@ -502,6 +510,7 @@ files:
|
|
502
510
|
- lib/rodauth/features/recovery_codes.rb
|
503
511
|
- lib/rodauth/features/remember.rb
|
504
512
|
- lib/rodauth/features/reset_password.rb
|
513
|
+
- lib/rodauth/features/reset_password_notify.rb
|
505
514
|
- lib/rodauth/features/session_expiration.rb
|
506
515
|
- lib/rodauth/features/single_session.rb
|
507
516
|
- lib/rodauth/features/sms_codes.rb
|
@@ -545,6 +554,7 @@ files:
|
|
545
554
|
- templates/recovery-codes.str
|
546
555
|
- templates/remember.str
|
547
556
|
- templates/reset-password-email.str
|
557
|
+
- templates/reset-password-notify-email.str
|
548
558
|
- templates/reset-password-request.str
|
549
559
|
- templates/reset-password.str
|
550
560
|
- templates/sms-auth.str
|
@@ -567,13 +577,13 @@ files:
|
|
567
577
|
- templates/webauthn-auth.str
|
568
578
|
- templates/webauthn-remove.str
|
569
579
|
- templates/webauthn-setup.str
|
570
|
-
homepage: https://
|
580
|
+
homepage: https://rodauth.jeremyevans.net
|
571
581
|
licenses:
|
572
582
|
- MIT
|
573
583
|
metadata:
|
574
584
|
bug_tracker_uri: https://github.com/jeremyevans/rodauth/issues
|
575
|
-
changelog_uri:
|
576
|
-
documentation_uri:
|
585
|
+
changelog_uri: https://rodauth.jeremyevans.net/rdoc/files/CHANGELOG.html
|
586
|
+
documentation_uri: https://rodauth.jeremyevans.net/documentation.html
|
577
587
|
mailing_list_uri: https://github.com/jeremyevans/rodauth/discussions
|
578
588
|
source_code_uri: https://github.com/jeremyevans/rodauth
|
579
589
|
post_install_message:
|