Created
December 6, 2012 08:13
-
-
Save conradchu/4222687 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if @new_user.save | |
if @invitation && @invitation.persisted? | |
# Mark private invites as used. | |
@invitation.deactivate unless @invitation.public? | |
# Send referrer feedback/rewards when the new user signs up. | |
@invitation.delay.reward_referrer_on_signup(@new_user) | |
end | |
session[:referrer_code] = nil | |
# Attempt to post sign up to FB wall if we are permitted to | |
Authentication.post_signup_to_fb(@new_user) if params[:share_friends] == 'yes' | |
flash[:mixpanel_analytics] = 'Customer Signup' | |
flash[:km_analytics] = "['record', 'signed up']" | |
# sign in and redirect | |
session[:user_return_to] ||= params[:return] || welcome_users_cp_path | |
sign_in_and_redirect @new_user and return | |
else | |
failure and return | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment