Skip to content
Browse files

Ooops, only you should be able to start and stop following people

  • Loading branch information...
1 parent db6e1e4 commit 74df792253a6a4eac1bcbe58cf64976aaad34455 @danlucraft committed May 24, 2009
Showing with 2 additions and 0 deletions.
  1. +2 −0 app.rb
View
2 app.rb
@@ -45,13 +45,15 @@ def redis
get '/:follower/follow/:followee' do |follower_username, followee_username|
follower = User.find_by_username(follower_username)
followee = User.find_by_username(followee_username)
+ redirect '/' unless @logged_in_user == follower
follower.follow(followee)
redirect "/" + followee_username
end
get '/:follower/stopfollow/:followee' do |follower_username, followee_username|
follower = User.find_by_username(follower_username)
followee = User.find_by_username(followee_username)
+ redirect '/' unless @logged_in_user == follower
follower.stop_following(followee)
redirect "/" + followee_username
end

0 comments on commit 74df792

Please sign in to comment.
Something went wrong with that request. Please try again.