diff --git a/app/controllers/manager/users_controller.rb b/app/controllers/manager/users_controller.rb index 4afabcdc5..86113022d 100644 --- a/app/controllers/manager/users_controller.rb +++ b/app/controllers/manager/users_controller.rb @@ -30,6 +30,13 @@ module Manager redirect_to manager_user_path(user) end + def resend_reset_password_instructions + user = User.find(params[:id]) + user.send_reset_password_instructions + flash[:notice] = "L'email de réinitialisation du mot de passe a été renvoyé." + redirect_to manager_user_path(user) + end + def enable_feature user = User.find(params[:id]) diff --git a/app/views/manager/users/emails.html.erb b/app/views/manager/users/emails.html.erb index 44b9cdb3e..b9f003cca 100644 --- a/app/views/manager/users/emails.html.erb +++ b/app/views/manager/users/emails.html.erb @@ -108,6 +108,11 @@ https://www.demarches-simplifiees.fr/users/password/new Cordialement <% end %> + + +
Mot de passe perdu ? Vous pouvez <%= link_to('renvoyer l’email de réinitialisation', [:resend_reset_password_instructions, namespace, :user], method: :post, class: 'button') %> + Attention au téléscopage: cet email invalide les liens des emails similaires précédents.
+Compte bloqué chez Sendinblue ? Vous pouvez le <%= link_to('débloquer', manager_user_unblock_email_path(@user), method: :put, class: 'button') %> diff --git a/config/routes.rb b/config/routes.rb index 0bbe21ec2..e295e8179 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -41,6 +41,7 @@ Rails.application.routes.draw do resources :users, only: [:index, :show, :edit, :update] do delete 'delete', on: :member post 'resend_confirmation_instructions', on: :member + post 'resend_reset_password_instructions', on: :member put 'enable_feature', on: :member get 'emails', on: :member put 'unblock_email'