passwordless 0.4.1 → 0.4.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: 1f03719e6034346b778069e91f121cbbc2eac0622e31595ef07a056cb0ac3301
4
- data.tar.gz: ea42e801a9a60d28f75a16ca17c9d42027c34d7f3d761514a4705d24950c02e7
3
+ metadata.gz: 75c3878f6173f614504aec1073969f86c5c62b52f987c2c3402ea75771d705b4
4
+ data.tar.gz: d5f7d2cbd330c33ac40213860653087a2d8977bcad1d936431fd5c41a03e60e7
5
5
  SHA512:
6
- metadata.gz: b6a9779ad51b363c0f9341abb88045d337f6acaee8dc2dd32c565bd2ecdac5608d1686e5bbf1e498b5db15a3cd435147fb4353af60027e191f1b7ea4454975e3
7
- data.tar.gz: 0ff640ef5688934b062cc1678df6ab858bc35bb02389f2e20f9e1fbccfbbb6aadcafea4ae0d05a64e5901876103df701d7db9519ec359bc9465588c61a16c4b3
6
+ metadata.gz: 0a1c0c33379fc8da5b45fb26e1bf89d27848be3c0d627bdf84257966cf5256e85c0e5e2129f5da2f39602a8346649d082dc9de1387886110580d1693619df922
7
+ data.tar.gz: 59528a2ec29c12b02de00616fd9b184b998d20d04124b5dbe08143fe7b9ca77f632395b60ae18052500b5b0ea84d9e4b7307df50200fed2a621d52c893106824
data/README.md CHANGED
@@ -48,7 +48,9 @@ Then specify which field on your `User` record is the email field with:
48
48
 
49
49
  ```ruby
50
50
  class User < ApplicationRecord
51
- passwordless_with :email
51
+ validates :email, presence: true, uniqueness: { case_sensitive: false }
52
+
53
+ passwordless_with :email # <-- here!
52
54
  end
53
55
  ```
54
56
 
@@ -87,11 +89,11 @@ class ApplicationController < ActionController::Base
87
89
  end
88
90
  ```
89
91
 
90
- Et voilá:
92
+ Et voilà:
91
93
 
92
94
  ```ruby
93
95
  class VerySecretThingsController < ApplicationController
94
- before_filter :require_user!
96
+ before_action :require_user!
95
97
 
96
98
  def index
97
99
  @things = current_user.very_secret_things
@@ -14,9 +14,9 @@ module Passwordless
14
14
 
15
15
  def create
16
16
  email_field = authenticatable_class.passwordless_email_field
17
- authenticatable = authenticatable_class.where(
18
- "lower(#{email_field}) = ?", params[:passwordless][email_field]
19
- ).first
17
+ email = params.require(:passwordless).fetch(email_field).downcase
18
+ authenticatable =
19
+ authenticatable_class.where("lower(#{email_field}) = ?", email).first
20
20
 
21
21
  session = Session.new.tap do |us|
22
22
  us.remote_addr = request.remote_addr
@@ -1,3 +1,3 @@
1
1
  module Passwordless
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passwordless
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.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: 2017-11-27 00:00:00.000000000 Z
11
+ date: 2017-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 5.1.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 5.1.4
27
27
  - !ruby/object:Gem::Dependency
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.7.2
103
+ rubygems_version: 2.7.3
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Summary of Passwordless.