yaag 0.4.0 → 0.6.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: 18c1b6d3d23b55ad72cad5da0351887ef2342ef4ebeb98a58fd9866315e96a25
4
- data.tar.gz: eedaef3e610a375ca2ab348f88883ac2205e0ba8c9984f029739755071637d70
3
+ metadata.gz: 28fe701af24dc5111f080f6cea180e91497b58d69948ba519029a4b7d0e26fcf
4
+ data.tar.gz: 9dca6dc7ad08eea82157586b91257dc22cf112e693f9d847bb6a70846aabb444
5
5
  SHA512:
6
- metadata.gz: 0a0eb30c69ce82211abbcf60cd54799e51ca9faadf06919d00e362eadb9e881c35a372674d74d306f112d76afc6daf9152042e3a972f38d74cf4e6ec359a83d7
7
- data.tar.gz: 8653b74715e0ef3ccd4075182ff111b18f11dcf089804c0d736b74b2340926ce5455b14f58cba127b19d71916e5ce1db20ca73ef5bac9a055cd991266fab8e44
6
+ metadata.gz: 2fdf622c38a7bbac5b81eeca4ac4ba33ead1bad6a7372a712d513426b031391761fbfbfa9eec9507d63f92c11361620c1084e96dcaf399f0b20606b44032f35c
7
+ data.tar.gz: 5304f7f0340deb4a8bdf59c50f3267823af7ac178bdeb32e0e7e2f153ac6552d93d5e2063cf4867199cc87997565af4b161eae09db638054e403d50511199713
@@ -17,6 +17,10 @@ module Authentication
17
17
  resume_session
18
18
  end
19
19
 
20
+ def current_user
21
+ Current.user
22
+ end
23
+
20
24
  def require_authentication
21
25
  resume_session || request_authentication
22
26
  end
@@ -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 mt-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" %><br>
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" %>
@@ -7,6 +7,8 @@ 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."
data/config/routes.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  Rails.application.routes.draw do
2
2
  resource :signin, only: [ :new, :create ]
3
- resource :session, only: [ :new, :destroy ] do
3
+ resource :session, only: [ :new, :create, :destroy ] do
4
4
  get "/:token/create" => "sessions#create", as: :create
5
5
  end
6
6
  end
@@ -16,6 +16,11 @@ module Yaag
16
16
  end
17
17
 
18
18
  alias :sign_in :sign_in_as
19
+
20
+ def assert_notice(text)
21
+ follow_redirect!
22
+ assert_select "div", /#{text}/
23
+ end
19
24
  end
20
25
  end
21
26
  end
data/lib/yaag/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yaag
2
- VERSION = "0.4.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nu12
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-01-14 00:00:00.000000000 Z
11
+ date: 2026-02-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Yet Another Authentication Gem (YAAG) provides passwordless authentication
14
14
  for your Ruby on Rails app, all it takes is the user's e-mail address.