Browse Source

Update user account routes

pull/400/head
Paul Robert Lloyd 3 years ago
parent
commit
6621d08898
  1. 2
      app/controllers/auth/passwords_controller.rb
  2. 23
      config/routes.rb

2
app/controllers/auth/passwords_controller.rb

@ -66,7 +66,7 @@ protected
end end
def after_sending_reset_password_instructions_path_for(_resource) 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 end
def after_resetting_password_path_for(resource) def after_resetting_password_path_for(resource)

23
config/routes.rb

@ -10,7 +10,11 @@ Rails.application.routes.draw do
confirmations: "active_admin/devise/confirmations", confirmations: "active_admin/devise/confirmations",
two_factor_authentication: "auth/two_factor_authentication", 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], 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" get "admin/two-factor-authentication/resend", to: "auth/two_factor_authentication#show_resend"
end end
devise_for :users, controllers: { devise_for :users, {
passwords: "auth/passwords", path: :account,
sessions: "auth/sessions", controllers: {
}, path_names: { sign_in: "sign-in", sign_out: "sign-out" } passwords: "auth/passwords",
sessions: "auth/sessions",
},
path_names: {
sign_in: "sign-in",
sign_out: "sign-out",
},
}
devise_scope :user do devise_scope :user do
get "confirmations/reset", to: "auth/passwords#reset_confirmation" get "account/password/reset-confirmation", to: "auth/passwords#reset_confirmation"
end end
get "/health", to: ->(_) { [204, {}, [nil]] } get "/health", to: ->(_) { [204, {}, [nil]] }

Loading…
Cancel
Save