]> cat aescling's git repositories - mastodon.git/commitdiff
Fix link_to_login argument handling when a block is passed (#17345)
authorClaire <claire.github-309c@sitedethib.com>
Mon, 24 Jan 2022 02:29:03 +0000 (03:29 +0100)
committerGitHub <noreply@github.com>
Mon, 24 Jan 2022 02:29:03 +0000 (03:29 +0100)
app/helpers/application_helper.rb

index 9e16de5b5bffae74e5eb75a494c1fd3b28a3f2ab..36c66b7d1951801ac0feb2788b5583db05866c69 100644 (file)
@@ -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 ||= {}