From 6c375297236ecd1df7a5e82c24ad025b46be46cc Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 11 Jul 2024 07:13:55 -0400 Subject: [PATCH] Use `module: :auth` to wrap `devise_for` routes config (#30990) --- config/routes.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 2c06762c229..e4f091043d6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -104,13 +104,9 @@ Rails.application.routes.draw do end end - devise_for :users, path: 'auth', format: false, controllers: { - omniauth_callbacks: 'auth/omniauth_callbacks', - sessions: 'auth/sessions', - registrations: 'auth/registrations', - passwords: 'auth/passwords', - confirmations: 'auth/confirmations', - } + scope module: :auth do + devise_for :users, path: 'auth', format: false + end with_options constraints: ->(req) { req.format.nil? || req.format.html? } do get '/users/:username', to: redirect_with_vary('/@%{username}')