From d045ba2adda840483d40ee02af8d5748640d2dba Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 24 Jan 2022 03:29:03 +0100 Subject: [PATCH] Fix link_to_login argument handling when a block is passed (#17345) --- app/helpers/application_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9e16de5b5b..36c66b7d19 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -64,6 +64,8 @@ module ApplicationHelper def link_to_login(name = nil, html_options = nil, &block) target = new_user_session_path + html_options = name if block_given? + if omniauth_only? && Devise.mappings[:user].omniauthable? && User.omniauth_providers.size == 1 target = omniauth_authorize_path(:user, User.omniauth_providers[0]) html_options ||= {}