bullet_train 1.4.1 → 1.4.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9521826a1552bab65baf10d7144bc10be7f61da32e17e799d498c3e7fdf32f82
|
4
|
+
data.tar.gz: cf4c3769472e2a4a25a497b1bc40ac95436dd83d9d0b06f78c23bfb30cc9c332
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6370f74971ba12c953ec66bd63edae2434457a0a84a07ec0dcab44685661026b1b57ba4b99377f2ef696c21bc63aaca6661008f4cc098aeed76fb55751aed68
|
7
|
+
data.tar.gz: 2705720d73d70dcd59ec85bc322d16f786ff6da81e3399a18b58b775a5a52befe7d8336e636f6544041843e829fd641d04096ab07d0cb865c8493f311b0333de
|
@@ -24,7 +24,17 @@ module Account::Users::ControllerBase
|
|
24
24
|
def show
|
25
25
|
end
|
26
26
|
|
27
|
+
def updating_password_or_email?
|
28
|
+
params[:user].key?(:password) || params[:user].key?(:email)
|
29
|
+
end
|
30
|
+
|
31
|
+
# TODO: We're keeping this method for backward compatibility in case someone in a downstream app
|
32
|
+
# might be using it. At some point in the future (unclear exactly when) we should remove it.
|
27
33
|
def updating_password?
|
34
|
+
ActiveSupport::Deprecation.warn(
|
35
|
+
"#updating_password? is deprecated. " \
|
36
|
+
"Use #updating_password_or_email? instead."
|
37
|
+
)
|
28
38
|
params[:user].key?(:password)
|
29
39
|
end
|
30
40
|
|
@@ -32,7 +42,7 @@ module Account::Users::ControllerBase
|
|
32
42
|
# PATCH/PUT /account/users/1.json
|
33
43
|
def update
|
34
44
|
respond_to do |format|
|
35
|
-
if
|
45
|
+
if updating_password_or_email? ? @user.update_with_password(user_params) : @user.update_without_password(user_params)
|
36
46
|
# if you update your own user account, devise will normally kick you out, so we do this instead.
|
37
47
|
bypass_sign_in current_user.reload
|
38
48
|
format.html { redirect_to [:edit, :account, @user], notice: t("users.notifications.updated") }
|
@@ -1,10 +1,6 @@
|
|
1
1
|
<%= form_for [:account, user], html: {id: dom_id(user, :details), class: 'form'} do |form| %>
|
2
2
|
<% with_field_settings form: form do %>
|
3
3
|
<div class="grid grid-cols-1 gap-y gap-x sm:grid-cols-2">
|
4
|
-
<div class="sm:col-span-2">
|
5
|
-
<%= render 'shared/fields/email_field', method: :email, options: {autofocus: true} %>
|
6
|
-
</div>
|
7
|
-
|
8
4
|
<div class="sm:col-span-1">
|
9
5
|
<%= render 'shared/fields/text_field', method: :first_name %>
|
10
6
|
</div>
|
@@ -23,18 +23,35 @@
|
|
23
23
|
<%= render 'account/users/oauth' %>
|
24
24
|
|
25
25
|
<%= render 'account/shared/box', divider: true do |box| %>
|
26
|
-
<% box.title t('.
|
26
|
+
<% box.title t('.email_and_password.header') %>
|
27
|
+
<% box.description t('.email_and_password.description') %>
|
27
28
|
<% box.body do %>
|
28
29
|
<% within_fields_namespace(:update_self) do %>
|
29
30
|
<%= form_for [:account, @user], html: {id: dom_id(@user, :password), class: 'form'} do |form| %>
|
30
31
|
<% with_field_settings form: form do %>
|
31
|
-
<%= render 'shared/fields/
|
32
|
-
|
33
|
-
|
32
|
+
<%= render 'shared/fields/email_field', method: :email, options: {autofocus: true} %>
|
33
|
+
|
34
|
+
<hr>
|
35
|
+
|
36
|
+
<p><%= t('.email_and_password.new_password') %></p>
|
37
|
+
|
38
|
+
<div class="grid grid-cols-1 gap-y gap-x sm:grid-cols-2">
|
39
|
+
<div class="sm:col-span-1">
|
40
|
+
<%= render 'shared/fields/password_field', method: :password, options: {show_strength_indicator: true}, other_options: { required: false } %>
|
41
|
+
</div>
|
42
|
+
<div class="sm:col-span-1">
|
43
|
+
<%= render 'shared/fields/password_field', method: :password_confirmation, other_options: { required: false, label: t('.email_and_password.confirm_new_password') } %>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<hr>
|
48
|
+
|
49
|
+
<p><%= t('.email_and_password.current_password') %></p>
|
50
|
+
<%= render 'shared/fields/password_field', method: :current_password, other_options: { required: true } %>
|
34
51
|
<% end %>
|
35
52
|
|
36
53
|
<div class="buttons">
|
37
|
-
<%= form.submit t('.buttons.
|
54
|
+
<%= form.submit t('.buttons.update_email_and_password'), class: "button" %>
|
38
55
|
</div>
|
39
56
|
<% end %>
|
40
57
|
<% end %>
|
@@ -5,20 +5,24 @@ en:
|
|
5
5
|
label: *label
|
6
6
|
buttons: &buttons
|
7
7
|
update_profile: Update Profile
|
8
|
-
|
8
|
+
update_email_and_password: Update Email & Password
|
9
9
|
edit:
|
10
10
|
section: "%{users_possessive} Profile"
|
11
11
|
profile:
|
12
12
|
header: Update Your Profile
|
13
|
-
description: You can update the
|
14
|
-
|
15
|
-
header: Update Your Password
|
13
|
+
description: You can update the way your name is displayed and your time zone.
|
14
|
+
email_and_password:
|
15
|
+
header: Update Your Email Address & Password
|
16
|
+
description: When you change these credentials we'll email you a confirmation.
|
17
|
+
new_password: If you don't want to change your password, leave these two fields blank.
|
18
|
+
current_password: For security reasons we need you to confirm your current password.
|
19
|
+
confirm_new_password: Confirm New Password
|
16
20
|
two_factor:
|
17
21
|
header: Two-Factor Authentication
|
18
22
|
description_enabled: 2FA is currently enabled for your account.
|
19
23
|
description_disabled: You can increase the security of your account by enabling two-factor authentication.
|
20
24
|
verification_fail: Verification failed. You can try enabling again. Please make sure you scan the new QR code with your Authenticator app.
|
21
|
-
verification_success: Success! Thanks for verifying. 2FA is now enabled.
|
25
|
+
verification_success: Success! Thanks for verifying. 2FA is now enabled.
|
22
26
|
warning: "In order to enable two-factor authentication, you <strong>must</strong> install an Authenticator app and <strong>enter your Verification Code from the app below</strong>. 2FA will not be enabled until you do so. This is to avoid you getting locked out of your account."
|
23
27
|
instructions: "Install <a href='https://authy.com/download/' target='_blank'>Authy</a> or <a href='https://support.google.com/accounts/answer/1066447'>Google Authentication</a> on your phone and scan the barcode displayed below."
|
24
28
|
recovery_codes: "You can also make a copy of the following recovery codes. Each one can help you get back into your account once should you lose access to the device you're using for two-factor authentication."
|
data/lib/bullet_train/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|