redirect after sign in

This commit is contained in:
Andreas Stephanides
2014-11-08 10:30:01 +01:00
parent 5b52a13a4c
commit 8aa52bc83c
2 changed files with 11 additions and 2 deletions

View File

@@ -13,6 +13,15 @@
end end
end end
end end
def after_sign_in_path_for(resource)
sign_in_url = new_user_session_path(:only_path => false, :protocol => 'http')
if request.referer == sign_in_url
super
else
stored_location_for(resource) || request.referer || root_path
end
end^
def get_theme def get_theme
if ThemesForRails.available_theme_names.include?(params[:theme]) if ThemesForRails.available_theme_names.include?(params[:theme])
params[:theme] params[:theme]