Browse Source

CLDC-4044: Allow sending activation emails for unconfirmed users that have logged in

looks like CORE treats this state functionally for reconfirmed users & has a unique email sent out

so instead, change code to account for this and allow for sending emails to unconfirmed but signed in users
CLDC-4044-reset-last-login-date-on-deactivation-flow
Samuel Young 5 days ago
parent
commit
28cd42ed3e
  1. 5
      app/models/user.rb
  2. 2
      app/views/users/show.html.erb

5
app/models/user.rb

@ -167,11 +167,6 @@ class User < ApplicationRecord
update!(
active: true,
reactivate_with_organisation: false,
# resetting these fields ensures that the 'resend confirmation instructions' button shows
# we have this button be based on sign in date than confirmation status to ensure that the
# user has successfully completed the entire login flow before we hide the button
last_sign_in_at: nil,
last_sign_in_ip: nil,
)
end

2
app/views/users/show.html.erb

@ -154,7 +154,7 @@
<div class="govuk-button-group">
<% if @user.active? %>
<%= govuk_button_link_to "Deactivate user", deactivate_user_path(@user), warning: true %>
<% if current_user.support? && @user.last_sign_in_at.nil? %>
<% if current_user.support? && (@user.last_sign_in_at.nil? || !@user.confirmed?) %>
<%= govuk_button_to "Resend invite link", resend_invite_user_path(@user), secondary: true %>
<% end %>
<% else %>

Loading…
Cancel
Save