login fix
This commit is contained in:
@@ -19,9 +19,24 @@
|
||||
if request.referer == sign_in_url
|
||||
super
|
||||
else
|
||||
stored_location_for(resource) || request.referer || root_path
|
||||
stored_location_for(resource) || root_path
|
||||
end
|
||||
end^
|
||||
end
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
|
||||
if user_signed_in?
|
||||
flash[:error] = "Not authorized to view this page"
|
||||
session[:user_return_to] = nil
|
||||
redirect_to root_url
|
||||
|
||||
else
|
||||
flash[:error] = "You must first login to view this page"
|
||||
session[:user_return_to] = request.url
|
||||
redirect_to "/users/sign_in"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def get_theme
|
||||
if ThemesForRails.available_theme_names.include?(params[:theme])
|
||||
params[:theme]
|
||||
|
||||
Reference in New Issue
Block a user