Skip to content
Browse files

clear session too

  • Loading branch information...
1 parent 33e009d commit 8d655ffb1a4baa7e1983cdadde1a7d58007386a8 @nov committed Sep 27, 2010
Showing with 6 additions and 1 deletion.
  1. +1 −1 app/controllers/facebooks_controller.rb
  2. +5 −0 lib/authentication.rb
View
2 app/controllers/facebooks_controller.rb
@@ -28,7 +28,7 @@ def create
end
def destroy
- current_user.destroy
+ unauthenticate
redirect_to root_url
end
View
5 lib/authentication.rb
@@ -34,6 +34,11 @@ def authenticate(user)
session[:current_user] = user.id
end
+ def unauthenticate
+ current_user.destroy
+ @current_user = session[:current_user] = nil
+ end
+
end
end

0 comments on commit 8d655ff

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