Skip to content
Browse files

added debugging

  • Loading branch information...
1 parent 50d3f13 commit bd7a740faf92b51fdac881d76850f1fad72e01fb @jeffdonthemic jeffdonthemic committed Dec 4, 2011
Showing with 4 additions and 1 deletion.
  1. +1 −0 app/controllers/application_controller.rb
  2. +3 −1 app/controllers/sessions_controller.rb
View
1 app/controllers/application_controller.rb
@@ -30,6 +30,7 @@ def current_access_token
access_token = client.authenticate :username => sfdc_username, :password => current_user.password
current_user.access_token = access_token
current_user.save
+ logger.info "[ApplicationController]==== returning new access token from authentication"
return current_user.access_token
# seem to get this error for brand new users after they are created
View
4 app/controllers/sessions_controller.rb
@@ -157,7 +157,7 @@ def callback
else
# try and create the user in sfdc
new_member_create_results = Services.new_member(current_access_token, as.get_hash)
-
+ logger.info "[SessionsController]==== tried creating a user in sfdc: #{new_member_create_results}"
if new_member_create_results[:success].eql?('true')
user = User.new(:username => new_member_create_results[:username],
@@ -166,10 +166,12 @@ def callback
if user.save
sign_in user
+ logger.info "[SessionsController]==== #{results[:sfdc_username]} created and signed in successfully. redirecting..."
# send the 'welcome' email
Resque.enqueue(WelcomeEmailSender, current_access_token, results[:sfdc_username]) unless ENV['MAILER_ENABLED'].eql?('false')
redirect_to session[:redirect_to_after_auth]
else
+ logger.error "[SessionsController]==== error saving new #{results[:sfdc_username]} member to database: #{user.errors.full_messages} "
render :inline => user.errors.full_messages
end

0 comments on commit bd7a740

Please sign in to comment.
Something went wrong with that request. Please try again.