passwordless 1.8.0 → 1.8.1

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: b0e00cb666dc0018cb5789bf9f3b9186e7d107631365847374aa718d547f872e
4
- data.tar.gz: dd7cf0cd6c95151f3987e827693f3bb78811b6eba50661a6c822a54e0788b908
3
+ metadata.gz: 971e8f0ab8571c17897b3e299c0733a555135e268537168ede2257162f6e7202
4
+ data.tar.gz: 2dfc64b642041c81aaad24b07237116c0250a3c5bc1686c4b7eff33cd4b109e8
5
5
  SHA512:
6
- metadata.gz: 664906f92b865e89863f5a886bacc119a1ccc1970eead36d7496a12545a8ce022553f30982bc4b8b852fee9b6cdb4580ae01e4c37d56e59ae52b026c836bbebc
7
- data.tar.gz: b02a2dd05dae19dd283a455da70690c8086bfd6958f78986b7b8ac6442fa31bdc627362e12a59f19c9e51f1fa15a7e47fced64c09529ed3c2aa0454cd33bb84a
6
+ metadata.gz: 8873bb31b26549582c9297b5ca95d6f1abb0279c2aede005111025bc45b3dcab5619e7f06cc27d5d63ef9e58d166c9c252d3fadc409e4c42e37fc7818a82d395
7
+ data.tar.gz: acddc79fafb500792d493f1d0ccd1f0ffd4fdda8ee02b279d2132b6a325770fb9ff1ceb36e86eb792c4f19743b9600e3ce515375626aa2daf91dc65e27dd8223
data/README.md CHANGED
@@ -275,11 +275,13 @@ Passwordless.configure do |config|
275
275
  config.after_session_confirm = ->(session, request) {
276
276
  user = session.authenticatable
277
277
  user.update!(
278
- email_verified: true.
278
+ email_verified: true,
279
279
  last_login_ip: request.remote_ip
280
280
  )
281
281
  }
282
282
  end
283
+ ```
284
+
283
285
  ### Token generation
284
286
 
285
287
  By default Passwordless generates short, 6-digit, alpha numeric tokens. You can change the generator using `Passwordless.config.token_generator` to something else that responds to `call(session)` eg.:
data/Rakefile CHANGED
@@ -18,12 +18,10 @@ load("rails/tasks/statistics.rake")
18
18
 
19
19
  require "bundler/gem_tasks"
20
20
 
21
- require "rake/testtask"
22
-
23
- Rake::TestTask.new(:test) do |t|
24
- t.libs << "test"
25
- t.pattern = "test/**/*_test.rb"
26
- t.verbose = false
21
+ task(:test) do
22
+ puts("Use `bin/rails test`")
23
+ puts("-" * 80)
24
+ system("bin/rails test")
27
25
  end
28
26
 
29
27
  task(default: :test)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Passwordless
4
4
  # :nodoc:
5
- VERSION = "1.8.0"
5
+ VERSION = "1.8.1"
6
6
  end
data/lib/passwordless.rb CHANGED
@@ -12,8 +12,17 @@ require "passwordless/token_digest"
12
12
  module Passwordless
13
13
  extend Configurable
14
14
 
15
+ LOCK = Mutex.new
16
+
15
17
  def self.context
16
- @context ||= Context.new
18
+ return @context if @context
19
+
20
+ # Routes are lazy loaded in Rails 8 so we need to load them to populate Context#resources.
21
+ Rails.application.try(:reload_routes_unless_loaded)
22
+
23
+ LOCK.synchronize do
24
+ @context ||= Context.new
25
+ end
17
26
  end
18
27
 
19
28
  def self.add_resource(resource, controller:, **defaults)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passwordless
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikkel Malmberg
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-10-25 00:00:00.000000000 Z
10
+ date: 2025-03-10 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
@@ -38,7 +37,6 @@ dependencies:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
39
  version: 3.1.11
41
- description:
42
40
  email:
43
41
  - mikkel@brnbw.com
44
42
  executables: []
@@ -77,7 +75,6 @@ homepage: https://github.com/mikker/passwordless
77
75
  licenses:
78
76
  - MIT
79
77
  metadata: {}
80
- post_install_message:
81
78
  rdoc_options: []
82
79
  require_paths:
83
80
  - lib
@@ -92,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
89
  - !ruby/object:Gem::Version
93
90
  version: '0'
94
91
  requirements: []
95
- rubygems_version: 3.5.22
96
- signing_key:
92
+ rubygems_version: 3.6.2
97
93
  specification_version: 4
98
94
  summary: Add authentication to your app without all the ickyness of passwords.
99
95
  test_files: []