Use GET for make_friend when the user is not logged in
The POST is only used to avoid cross site attacks against logged in users, and the login form will defeat that for users that are not logged in, so use GET when not logged in so that the redirect to the login form will be done.
This commit is contained in:
parent
80903324cf
commit
b650a22725
1 changed files with 3 additions and 1 deletions
|
@ -75,8 +75,10 @@
|
|||
<li>
|
||||
<% if @user and @user.is_friends_with?(@this_user) %>
|
||||
<%= link_to t('user.view.remove as friend'), remove_friend_path(:display_name => @this_user.display_name), :method => :post %>
|
||||
<% else %>
|
||||
<% elsif @user %>
|
||||
<%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name), :method => :post %>
|
||||
<% else %>
|
||||
<%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name) %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue