Browse files

Added default redirect path config option

  • Loading branch information...
1 parent e8413ec commit 3d49a41944433cf7956986926d500b4b07ce514d Burke Libbey committed Mar 6, 2012
Showing with 6 additions and 2 deletions.
  1. +1 −1 app/controllers/sessions_controller.rb
  2. +5 −1 lib/google_auth.rb
View
2 app/controllers/sessions_controller.rb
@@ -13,7 +13,7 @@ def create
user.save!
session[:user_id] = user.id
- redirect_to session[:redirect] || root_url
+ redirect_to session[:redirect] || GoogleAuth.default_redirect_path
else
render '/auth/failure'
end
View
6 lib/google_auth.rb
@@ -14,6 +14,10 @@ def self.path
'g'
end
+ def self.default_redirect_path
+ Rails.application.config.google_auth.default_redirect_path || "/"
+ end
+
def self.user_class
klass = Rails.application.config.google_auth.user_class
return klass if klass
@@ -25,4 +29,4 @@ def self.user_class
end
end
-end
+end

0 comments on commit 3d49a41

Please sign in to comment.