<commit_before>module SimpleUser
	class Users::RegistrationsController < Devise::RegistrationsController

		  def after_sign_up_path_for(resource)
		  	if ENV['REDIRECT_USER_AFTER_SIGNIN'] == 'false' || !defined?(session[:return_to]) || session[:return_to] == "/" ||  session[:return_to].nil?
		    	after_sign_in_path_for(resource)
		    else
		    	return_to = session[:return_to]
		    	return_to
		    end
		  end

	end
end<commit_msg>Change redirect after sign up 2<commit_after>module SimpleUser
	class Users::RegistrationsController < Devise::RegistrationsController

		  before_filter :set_user_return_to

		  def set_user_return_to
			  url = request.referer
			  namespace_name = url.split('/')[3] rescue ""

			  if namespace_name != "simple_user"
			    session[:return_to] = request.referer
			  end
		  end

		  def after_sign_up_path_for(resource)
		  	if ENV['REDIRECT_USER_AFTER_SIGNIN'] == 'false' || !defined?(session[:return_to]) || session[:return_to] == "/" ||  session[:return_to].nil?
		    	after_sign_in_path_for(resource)
		    else
		    	return_to = session[:return_to]
		    	session[:return_to] = "/"
		    	return_to
		    end
		  end

	end
end
{'fraction_non_alphanumeric': 0.11054421768707483, 'fraction_numerical': 0.0017006802721088435, 'mean_word_length': 3.745967741935484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1461356', 'n_tokens_mistral': 445, 'n_tokens_neox': 389, 'n_words': 65}