From 6621d0889825178254168cc0e9e44d8f29d65d62 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Mon, 21 Mar 2022 11:42:05 +0000 Subject: [PATCH] Update user account routes --- app/controllers/auth/passwords_controller.rb | 2 +- config/routes.rb | 23 +++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/controllers/auth/passwords_controller.rb b/app/controllers/auth/passwords_controller.rb index c1222764b..1105c0475 100644 --- a/app/controllers/auth/passwords_controller.rb +++ b/app/controllers/auth/passwords_controller.rb @@ -66,7 +66,7 @@ protected end def after_sending_reset_password_instructions_path_for(_resource) - confirmations_reset_path(email: params.dig(resource_class_name, "email")) + account_password_reset_confirmation_path(email: params.dig(resource_class_name, "email")) end def after_resetting_password_path_for(resource) diff --git a/config/routes.rb b/config/routes.rb index 6446e718f..25a0a8e43 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,7 +10,11 @@ Rails.application.routes.draw do confirmations: "active_admin/devise/confirmations", two_factor_authentication: "auth/two_factor_authentication", }, - path_names: { sign_in: "sign-in", sign_out: "sign-out", two_factor_authentication: "two-factor-authentication" }, + path_names: { + sign_in: "sign-in", + sign_out: "sign-out", + two_factor_authentication: "two-factor-authentication", + }, sign_out_via: %i[get], } @@ -18,13 +22,20 @@ Rails.application.routes.draw do get "admin/two-factor-authentication/resend", to: "auth/two_factor_authentication#show_resend" end - devise_for :users, controllers: { - passwords: "auth/passwords", - sessions: "auth/sessions", - }, path_names: { sign_in: "sign-in", sign_out: "sign-out" } + devise_for :users, { + path: :account, + controllers: { + passwords: "auth/passwords", + sessions: "auth/sessions", + }, + path_names: { + sign_in: "sign-in", + sign_out: "sign-out", + }, + } devise_scope :user do - get "confirmations/reset", to: "auth/passwords#reset_confirmation" + get "account/password/reset-confirmation", to: "auth/passwords#reset_confirmation" end get "/health", to: ->(_) { [204, {}, [nil]] }