devise-passwordless 0.3.0 → 0.4.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c07993e3995252a9cdc3e65f5fd8a21564bde80e33244310ff4d0b3d553d49c
|
4
|
+
data.tar.gz: 329ce513cb9d7b8e85f39d8d85ce32d2192c653237750722e7a010a750541a33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd1df26917844eab3030415ae4ecb2507925ddd957885767c2278653d86c43a0d5727223dc8fc67623348088e9957ab981302cec32b72d2785b60d6e9606d96a
|
7
|
+
data.tar.gz: 5009df7b815ee82e211e6e47508038f8b3c9d94d4fff693c40c54b6cd84c244226038fe4630541ef8ce1528c1d6fd9f5fd19ad79e64fd236a25e5c75f01b3ec3
|
data/README.md
CHANGED
@@ -6,6 +6,7 @@ A passwordless a.k.a. "magic link" login strategy for [Devise][]
|
|
6
6
|
|
7
7
|
* No database migrations / state needed - links are stateless encrypted tokens thanks to Rails's MessageEncryptor
|
8
8
|
* Magic links are sent from your app - not a mounted Rails engine - so path and URL helpers work as expected
|
9
|
+
* Multiple user types
|
9
10
|
* All the goodness of Devise!
|
10
11
|
|
11
12
|
## Installation
|
@@ -94,7 +95,8 @@ Configuration options are stored in Devise's initializer at `config/initializers
|
|
94
95
|
# ==> Configuration for :magic_link_authenticatable
|
95
96
|
|
96
97
|
# Need to use a custom Devise mailer in order to send magic links
|
97
|
-
|
98
|
+
require "devise/passwordless/mailer"
|
99
|
+
config.mailer = "Devise::Passwordless::Mailer"
|
98
100
|
|
99
101
|
# Time period after a magic login link is sent out that it will be valid for.
|
100
102
|
# config.passwordless_login_within = 20.minutes
|
@@ -13,7 +13,8 @@ module Devise::Passwordless
|
|
13
13
|
# ==> Configuration for :magic_link_authenticatable
|
14
14
|
|
15
15
|
# Need to use a custom Devise mailer in order to send magic links
|
16
|
-
|
16
|
+
require "devise/passwordless/mailer"
|
17
|
+
config.mailer = "Devise::Passwordless::Mailer"
|
17
18
|
|
18
19
|
# Time period after a magic login link is sent out that it will be valid for.
|
19
20
|
# config.passwordless_login_within = 20.minutes
|
@@ -32,19 +33,6 @@ module Devise::Passwordless
|
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
35
|
-
def add_custom_devise_mailer
|
36
|
-
create_file "app/mailers/passwordless_mailer.rb" do <<~'FILE'
|
37
|
-
class PasswordlessMailer < Devise::Mailer
|
38
|
-
def magic_link(record, token, remember_me, opts = {})
|
39
|
-
@token = token
|
40
|
-
@remember_me = remember_me
|
41
|
-
devise_mail(record, :magic_link, opts)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
FILE
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
36
|
def add_mailer_view
|
49
37
|
create_file "app/views/devise/mailer/magic_link.html.erb" do <<~'FILE'
|
50
38
|
<p>Hello <%= @resource.email %>!</p>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-passwordless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abe Voelker
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- lib/devise/models/magic_link_authenticatable.rb
|
87
87
|
- lib/devise/passwordless.rb
|
88
88
|
- lib/devise/passwordless/login_token.rb
|
89
|
+
- lib/devise/passwordless/mailer.rb
|
89
90
|
- lib/devise/passwordless/version.rb
|
90
91
|
- lib/devise/strategies/magic_link_authenticatable.rb
|
91
92
|
- lib/generators/devise/passwordless/controller_generator.rb
|