From 5d2ae6e93f71c077e220b880d30f3c0dddda931e Mon Sep 17 00:00:00 2001 From: yottanami Date: Mon, 7 Sep 2026 20:58:51 +0200 Subject: [PATCH 1/2] Fix misleading docstring on require_no_authentication The comment said 'no authentication is required', which reads as 'either state is fine'. The method actually enforces the opposite: the user must NOT be authenticated, redirecting already-signed-in users away. Comment-only fix; method name and behavior are unchanged. --- app/controllers/devise_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/devise_controller.rb b/app/controllers/devise_controller.rb index 1c3b41626d..8e297e2016 100644 --- a/app/controllers/devise_controller.rb +++ b/app/controllers/devise_controller.rb @@ -109,7 +109,7 @@ def resource=(new_resource) instance_variable_set(:"@#{resource_name}", new_resource) end - # Helper for use in before_actions where no authentication is required. + # Helper for use in before_actions where it is required that the user is NOT authenticated. # # Example: # before_action :require_no_authentication, only: :new From 2e4cfaf2a65b6487036caad4b0447f21f7b32dc6 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Mon, 5 Oct 2026 08:59:53 -0300 Subject: [PATCH 2/2] Use `resource` for a more generic comment Signed-off-by: Carlos Antonio da Silva --- app/controllers/devise_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/devise_controller.rb b/app/controllers/devise_controller.rb index 8e297e2016..971c3bc4a6 100644 --- a/app/controllers/devise_controller.rb +++ b/app/controllers/devise_controller.rb @@ -109,7 +109,8 @@ def resource=(new_resource) instance_variable_set(:"@#{resource_name}", new_resource) end - # Helper for use in before_actions where it is required that the user is NOT authenticated. + # Helper for use in before_actions where it is required that the resource + # is NOT authenticated. # # Example: # before_action :require_no_authentication, only: :new