Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added routes and redirection

  • Loading branch information...
commit 57619d6c598609070b9b501516257d9e986fb9a7 1 parent b0644f3
@mattetti authored
View
6 app/controllers/application_controller.rb
@@ -4,7 +4,11 @@ class ApplicationController < ActionController::Base
private
def auth_required
- session[:current_user]
+ if session[:current_user]
+ true
+ else
+ redirect_to "/auth/twitter"
+ end
end
def twitter_client
View
3  app/controllers/sessions_controller.rb
@@ -1,7 +1,8 @@
class SessionsController < ApplicationController
+
def create
session[:current_user] = { 'info' => auth_hash['info'], 'credentials' => auth_hash['credentials'] }
- redirect_to '/'
+ redirect_to tweets_path
end
protected
View
2  config/routes.rb
@@ -51,7 +51,7 @@
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
- # root :to => 'welcome#index'
+ root :to => 'tweets#index'
# See how all your routes lay out with "rake routes"
Please sign in to comment.
Something went wrong with that request. Please try again.