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 +4 -4
- data/README.md +5 -3
- data/app/controllers/passwordless/sessions_controller.rb +3 -3
- data/lib/passwordless/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75c3878f6173f614504aec1073969f86c5c62b52f987c2c3402ea75771d705b4
|
4
|
+
data.tar.gz: d5f7d2cbd330c33ac40213860653087a2d8977bcad1d936431fd5c41a03e60e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
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
|
data/lib/passwordless/version.rb
CHANGED
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.
|
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
|
+
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.
|
103
|
+
rubygems_version: 2.7.3
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Summary of Passwordless.
|