devise-passwordless 0.3.0 → 0.4.0

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: 15837103c0aa116898d6b9847813c8ddf11d5e9e42fb3592322521b1107a96b0
4
- data.tar.gz: e4d86d9d88ed12151a91490d9360440d9bbf68570f9fc7fc9a49ecadffa17d00
3
+ metadata.gz: 0c07993e3995252a9cdc3e65f5fd8a21564bde80e33244310ff4d0b3d553d49c
4
+ data.tar.gz: 329ce513cb9d7b8e85f39d8d85ce32d2192c653237750722e7a010a750541a33
5
5
  SHA512:
6
- metadata.gz: a834c844bdc0e1cc638140ae5081f7714d24637837c7b5f84b6c14f32819c5e41316b1a29b57ac65f2d8e76781a8ce20a55b51dbb8f30489bdb4af94f131a25b
7
- data.tar.gz: 9b5703b2c793916342f9f044ea81ec1a626b0450cab2c0d91f4c56bc811ed7ccfee736db88715bae4d920729b3b56bbafaac781062dbf44b9cb016d73c15e7ce
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
- config.mailer = "PasswordlessMailer"
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
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Devise::Passwordless
4
+ class Mailer < Devise::Mailer
5
+ def magic_link(record, token, remember_me, opts = {})
6
+ @token = token
7
+ @remember_me = remember_me
8
+ devise_mail(record, :magic_link, opts)
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module Passwordless
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -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
- config.mailer = "PasswordlessMailer"
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.3.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