passwordless 0.8.1 → 0.8.2

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: 804b060cf61c385d7ea03251dc823732fdef08019793f7c5e537c5711cfba2cb
4
- data.tar.gz: 9b4510883e6d796f263701ca4f04669a2c215e36752c1b7a1aa7a302ce9bea1d
3
+ metadata.gz: b19e22b9a7152b299c8f639339709ebeaa3616ecfd7a85f461af205d8f6ad635
4
+ data.tar.gz: 8858c326d1457db832e08909957948d49d525bde1d45effa52e4d8e9b22f0374
5
5
  SHA512:
6
- metadata.gz: 6768a39dabea6bc87b205b3648d5a8d9d0b50c9d864fca8e60508a3be7a9567a9edc3807cc067f006eba0d719252f1302f6adcafd69c8ce0d4ba7039b6a8c0d7
7
- data.tar.gz: 0f1365cb5443a3418f2377bb6be5e22520715e3430df12df0c38d197ed4c7c17885e01a1602969e340f909cf9114454ee6ea374418aa5189001c2aff37e940bf
6
+ metadata.gz: 146b741cd502a702a10ed5169575eb5d6e9c47b0be8469e74b4e2369d2ecb82c1845624afe04aac2cac4e701deb6ea726e916dc1019007bdacd48e510272c9b7
7
+ data.tar.gz: f95c455c20f127c1a86c0df6763afdf2f90312afd429b81f96b8dd1e0901ac17c7cb3e8c1ff38d858d5208149eedf8257eff0b1e40809aa58c2189df58d1f90b
data/README.md CHANGED
@@ -228,7 +228,7 @@ config/initializers/passwordless.rb
228
228
  ```
229
229
  Passwordless.after_session_save = lambda do |session, request|
230
230
  # Default behavior is
231
- # Mailer.magic_link(session).deliver_now
231
+ # Passwordless::Mailer.magic_link(session).deliver_now
232
232
 
233
233
  # You can change behavior to do something with session model. For example,
234
234
  # session.authenticatable.send_sms
@@ -19,7 +19,7 @@ module Passwordless
19
19
  before_validation :set_defaults
20
20
 
21
21
  scope :available, lambda {
22
- where("timeout_at > ?", Time.current)
22
+ where("expires_at > ?", Time.current)
23
23
  }
24
24
 
25
25
  def self.valid
@@ -47,7 +47,7 @@ module Passwordless
47
47
  end
48
48
 
49
49
  def available?
50
- !timed_out? && !expired?
50
+ !expired?
51
51
  end
52
52
 
53
53
  private
@@ -44,11 +44,11 @@ module Passwordless
44
44
  def upgrade_passwordless_cookie(authenticatable_class)
45
45
  key = cookie_name(authenticatable_class)
46
46
 
47
- return unless authenticatable_id = cookies.encrypted[key]
47
+ return unless (authenticatable_id = cookies.encrypted[key])
48
48
  cookies.encrypted.permanent[key] = {value: nil}
49
49
  cookies.delete(key)
50
50
 
51
- return unless record = authenticatable_class.find_by(id: authenticatable_id)
51
+ return unless (record = authenticatable_class.find_by(id: authenticatable_id))
52
52
  new_session = build_passwordless_session(record).tap { |s| s.save! }
53
53
 
54
54
  sign_in new_session
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Passwordless
4
- VERSION = "0.8.1" # :nodoc:
4
+ VERSION = "0.8.2" # :nodoc:
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passwordless
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikkel Malmberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-14 00:00:00.000000000 Z
11
+ date: 2019-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []
131
- rubygems_version: 3.0.4
131
+ rubygems_version: 3.0.3
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Add authentication to your app without all the ickyness of passwords.