lato 3.6.0 → 3.6.1

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: 124f38d5389e35689d3829980d788e5531af092d45fd378b5fbaabdc039ebe51
4
- data.tar.gz: e6a938bc4549803deb41efd7df596e85148d84488d442f75ac46b9bb8c0191bd
3
+ metadata.gz: 0b455041febf6fa0199543a3540a560dce02db7840ae8a6efc274018961b1d44
4
+ data.tar.gz: d0694e1fd297058319ddaac053256ed7fd053ca80a04cb41332e4b2dfe757b52
5
5
  SHA512:
6
- metadata.gz: fed883559fd4d1859aacc7ca6ca2dc2d65935c1d91d769c23ba71b940d2067cc8d320b84512a9adbd6b0a1540f7e3b33098664c89298a18277fda7fa548a7dc9
7
- data.tar.gz: 9b87edd528d4c10bb7c82f4b8fa7769d6625560668657dea98b085661d22696c215d138fc3a5af0947d22cfb20c63b014503f472d99516bf6b0594398809e0ca
6
+ metadata.gz: d6d1b5d9c26e8d00013d9ca8304d893c397e0f01670a6a1a6deb502efce183d03dd9ae2c0d8c6fec689a66da6e1b4f573f363ebb3e79c5bab4e7380c8766434b
7
+ data.tar.gz: d091db10a8e2ae22476886330d068f817e5a5cad1893465a9d5d57b4fc14653624b0e6947da9debcd54b4a77c5782506df9c2273ae27ce16ee36e09b9b8546bc
@@ -66,6 +66,9 @@ main {
66
66
 
67
67
  aside {
68
68
  width: 280px;
69
+ max-height: 100vh;
70
+ position: sticky;
71
+ top: 0;
69
72
  }
70
73
 
71
74
  main, aside {
@@ -117,3 +120,10 @@ main, aside {
117
120
  border-radius: 50%;
118
121
  }
119
122
  }
123
+
124
+ .lato-index-col-sort {
125
+ .btn {
126
+ font-size: 12px;
127
+ padding: 0.15rem 0.3rem;
128
+ }
129
+ }
@@ -58,13 +58,25 @@ module Lato
58
58
  def update_authenticator_action
59
59
  return respond_to_with_not_found unless Lato.config.authenticator_connection
60
60
 
61
- respond_to do |format|
62
- if @session.user.generate_authenticator_secret
63
- format.html { redirect_to lato.account_path }
64
- format.json { render json: @session.user }
65
- else
66
- format.html { render :index, status: :unprocessable_entity }
67
- format.json { render json: @session.user.errors, status: :unprocessable_entity }
61
+ if @session.user.authenticator_secret
62
+ respond_to do |format|
63
+ if @session.user.remove_authenticator_secret
64
+ format.html { redirect_to lato.account_path }
65
+ format.json { render json: @session.user }
66
+ else
67
+ format.html { render :index, status: :unprocessable_entity }
68
+ format.json { render json: @session.user.errors, status: :unprocessable_entity }
69
+ end
70
+ end
71
+ else
72
+ respond_to do |format|
73
+ if @session.user.generate_authenticator_secret
74
+ format.html { redirect_to lato.account_path }
75
+ format.json { render json: @session.user }
76
+ else
77
+ format.html { render :index, status: :unprocessable_entity }
78
+ format.json { render json: @session.user.errors, status: :unprocessable_entity }
79
+ end
68
80
  end
69
81
  end
70
82
  end
@@ -306,6 +306,10 @@ module Lato
306
306
  update(authenticator_secret: ROTP::Base32.random)
307
307
  end
308
308
 
309
+ def remove_authenticator_secret
310
+ update(authenticator_secret: nil)
311
+ end
312
+
309
313
  def authenticator(params)
310
314
  return false unless authenticator_enabled?
311
315
 
@@ -12,17 +12,17 @@ user ||= Lato::User.new
12
12
  <% if user.authenticator_secret %>
13
13
  <div class="d-block d-md-flex align-items-stretch">
14
14
  <div class="text-center mb-3 mb-md-0 me-md-3">
15
- <img src="<%= user.authenticator_qr_code_base64 %>" />
15
+ <img class="shadow-sm rounded" src="<%= user.authenticator_qr_code_base64 %>" />
16
16
  </div>
17
17
  <div class="d-flex flex-column justify-content-between">
18
18
  <div class="alert alert-light">
19
- <p>
19
+ <p class="mb-0">
20
20
  <%= raw I18n.t('lato.account_authenticator_ready_qr') %>
21
21
  </p>
22
22
  </div>
23
23
 
24
24
  <div class="d-flex justify-content-end">
25
- <%= lato_form_submit form, I18n.t('lato.reset_qr_code'), class: %w[btn-danger] %>
25
+ <%= lato_form_submit form, I18n.t('lato.cancel_authenticator'), class: %w[btn-danger] %>
26
26
  </div>
27
27
  </div>
28
28
  </div>
@@ -89,7 +89,7 @@ collection_total = collection.respond_to?(:total_count) ? collection.total_count
89
89
  column: column
90
90
  }) %></span>
91
91
  <% if sortable_columns.include?(column) %>
92
- <div class="btn-group ms-3">
92
+ <div class="btn-group ms-3 lato-index-col-sort">
93
93
  <div class="position-relative btn btn-sm <%= params[:sort_by] == "#{column}|ASC" ? 'btn-primary' : 'btn-outline-primary' %>">
94
94
  <input type="submit" name="sort_by" value="<%= column %>|ASC" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0">
95
95
  <i class="bi bi-sort-up"></i>
@@ -54,7 +54,7 @@ en:
54
54
  account_authenticator_start_description: Generate a QR code by clicking the button below and scan it with the Google Authenticator app on your phone.<br>This will allow you to use the protect your account with a second factor authentication.
55
55
  account_authenticator_ready_qr: Scan the QR code with the Google Authenticator app to use the account protection with a second factor authentication.
56
56
  generate_qr_code: Generate QR code
57
- reset_qr_code: Reset QR code
57
+ cancel_authenticator: Disconnect
58
58
  authenticator: Two-factor authentication
59
59
  authenticator_code_help: Insert the code generated by the Google Authenticator app for the account <b>%{email}</b>
60
60
  reset_password: Reset your password
@@ -56,7 +56,7 @@ it:
56
56
  account_authenticator_start_description: Genera un codice QR cliccando il pulsante sottostante e scansionalo con l'app Google Authenticator sul tuo telefono.<br>Questo ti permetterà di proteggere il tuo account con un'autenticazione a due fattori.
57
57
  account_authenticator_ready_qr: Scansiona il codice QR con l'app Google Authenticator per utilizzare la protezione dell'account con un'autenticazione a due fattori.
58
58
  generate_qr_code: Genera codice QR
59
- reset_qr_code: Resetta codice QR
59
+ cancel_authenticator: Disconnetti
60
60
  authenticator: Autenticazione a due fattori
61
61
  authenticator_code_help: Inserisci il codice generato dall'app Google Authenticator per l'account <b>%{email}</b>
62
62
  reset_password: Reimposta la tua password
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.6.0"
2
+ VERSION = "3.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0
4
+ version: 3.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante