yaag 0.5.0 → 0.7.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 +4 -4
- data/app/views/sessions/new.html.erb +13 -0
- data/app/views/signins/new.html.erb +2 -2
- data/app/views/signins_mailer/token.html.erb +5 -2
- data/app/views/signins_mailer/token.text.erb +2 -2
- data/config/locales/en.yml +8 -1
- data/config/routes.rb +1 -1
- data/lib/generators/authentication/templates/README +4 -0
- data/lib/yaag/version.rb +1 -1
- data/lib/yaag.rb +3 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6672037e3797f2c7db2842a908ed27890c8859e9f90c06de41a4a8da94482d4e
|
|
4
|
+
data.tar.gz: f4f1524c4d80a48a5fc30e9ef355928ad0c68c7479ab8ad7b55ff4c1e136f99a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 28a2aed0a2b713fee0c2301cff376df6dcbe3329ac3a5bc5da2d7c77ace743dcd0322dae7e3d8043527f841dc0c23560894e01c3e52b97c1b9fa5bf0a450e74f
|
|
7
|
+
data.tar.gz: dd41ba4a3386b9523e77ab2b0c9d72fefd405ad994325a119de8f043af2ab4b5a52e29def2492e1f52fb311b64bf834de963ecb955693c8722c129764eb42b7b
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %>
|
|
2
2
|
<%= tag.div(flash[:notice], style: "color:green") if flash[:notice] %>
|
|
3
|
+
|
|
4
|
+
<div class="container w-50 ">
|
|
5
|
+
<h2>Sign In (Continuation)</h2>
|
|
6
|
+
<%= form_with url: session_path, method: :post do |form| %>
|
|
7
|
+
<div class="field py-3">
|
|
8
|
+
<%= form.text_field :token, required: true, placeholder: t("yaag.forms.session_placeholder"), class: "form-control" %>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="actions">
|
|
11
|
+
<%= form.submit t("yaag.forms.signin_button"), class: "form-control btn btn-primary" %>
|
|
12
|
+
</div>
|
|
13
|
+
<%= link_to t("yaag.forms.return_to_signin_form"), new_signin_path %>
|
|
14
|
+
<% end %>
|
|
15
|
+
</div>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<div class="container w-50 ">
|
|
5
5
|
<h2>Sign In</h2>
|
|
6
6
|
<%= form_with url: signin_path do |form| %>
|
|
7
|
-
<div class="field
|
|
8
|
-
<%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: t("yaag.forms.signin_placeholder"), value: params[:email_address], class: "form-control"
|
|
7
|
+
<div class="field py-3">
|
|
8
|
+
<%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: t("yaag.forms.signin_placeholder"), value: params[:email_address], class: "form-control" %>
|
|
9
9
|
</div>
|
|
10
10
|
<div class="actions mb-3">
|
|
11
11
|
<%= form.submit t("yaag.forms.signin_button"), class: "form-control btn btn-primary" %>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<p>
|
|
2
|
-
|
|
2
|
+
<%= t("yaag.mailers.html_text") %>:
|
|
3
3
|
</p>
|
|
4
4
|
<p>
|
|
5
|
-
|
|
5
|
+
<%= link_to t("yaag.mailers.signin_button"), create_session_url(@user.email_address_login_token) %>
|
|
6
|
+
</p>
|
|
7
|
+
<p>
|
|
8
|
+
<%= t("yaag.mailers.expiration_notice") %> <%= distance_of_time_in_words(0, @user.email_address_login_token_expires_in) %>.
|
|
6
9
|
</p>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
<%= t("yaag.mailers.txt_text") %>:
|
|
2
2
|
|
|
3
3
|
<%= create_session_url(@user.email_address_login_token) %>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<%= t("yaag.mailers.expiration_notice") %> <%= distance_of_time_in_words(0, @user.email_address_login_token_expires_in) %>.
|
data/config/locales/en.yml
CHANGED
|
@@ -7,9 +7,16 @@ en:
|
|
|
7
7
|
forms:
|
|
8
8
|
signin_button: "Sign in"
|
|
9
9
|
signin_placeholder: "Enter your email address"
|
|
10
|
+
session_placeholder: "Enter a valid token"
|
|
11
|
+
return_to_signin_form: "Back to sign in page"
|
|
10
12
|
sessions:
|
|
11
13
|
successful: "Signed in successfully."
|
|
12
14
|
destroy: "Signed out successfully."
|
|
13
15
|
signins:
|
|
14
16
|
email_sent: "Sign in address sent to provided e-mail."
|
|
15
|
-
email_subject: "Sign in link"
|
|
17
|
+
email_subject: "Sign in link"
|
|
18
|
+
mailers:
|
|
19
|
+
html_text: "To sign in, click the link below"
|
|
20
|
+
txt_text: "To sign in, copy the link below and paste it in a browser"
|
|
21
|
+
signin_button: "Sign In"
|
|
22
|
+
expiration_notice: "This link will expire in"
|
data/config/routes.rb
CHANGED
|
@@ -32,6 +32,10 @@ end
|
|
|
32
32
|
|
|
33
33
|
More generators available for customizations:
|
|
34
34
|
|
|
35
|
+
./bin/rails db:migrate g authentication:copy:channels
|
|
36
|
+
./bin/rails db:migrate g authentication:copy:controllers
|
|
37
|
+
./bin/rails db:migrate g authentication:copy:mailers
|
|
38
|
+
./bin/rails db:migrate g authentication:copy:models
|
|
35
39
|
./bin/rails db:migrate g authentication:copy:views
|
|
36
40
|
|
|
37
41
|
===============================================================
|
data/lib/yaag/version.rb
CHANGED
data/lib/yaag.rb
CHANGED
|
@@ -21,7 +21,9 @@ module Yaag
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
module ClassMethods
|
|
24
|
-
def has_passwordless_login
|
|
24
|
+
def has_passwordless_login
|
|
25
|
+
attribute = :email_address
|
|
26
|
+
|
|
25
27
|
include InstanceMethodsOnActivation.new(attribute)
|
|
26
28
|
|
|
27
29
|
if respond_to?(:generates_token_for)
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yaag
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- nu12
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: Yet Another Authentication Gem (YAAG) provides passwordless authentication
|
|
14
13
|
for your Ruby on Rails app, all it takes is the user's e-mail address.
|
|
@@ -56,7 +55,6 @@ licenses:
|
|
|
56
55
|
metadata:
|
|
57
56
|
homepage_uri: https://github.com/nu12/yaag
|
|
58
57
|
source_code_uri: https://github.com/nu12/yaag
|
|
59
|
-
post_install_message:
|
|
60
58
|
rdoc_options: []
|
|
61
59
|
require_paths:
|
|
62
60
|
- lib
|
|
@@ -71,8 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
71
69
|
- !ruby/object:Gem::Version
|
|
72
70
|
version: '0'
|
|
73
71
|
requirements: []
|
|
74
|
-
rubygems_version: 3.
|
|
75
|
-
signing_key:
|
|
72
|
+
rubygems_version: 3.6.9
|
|
76
73
|
specification_version: 4
|
|
77
74
|
summary: Passwordless authentication for your Ruby on Rails app.
|
|
78
75
|
test_files: []
|