diff --git a/app/lib/GPlusHandler.coffee b/app/lib/GPlusHandler.coffee index e69c7db79..411b1e26b 100644 --- a/app/lib/GPlusHandler.coffee +++ b/app/lib/GPlusHandler.coffee @@ -91,7 +91,9 @@ module.exports = GPlusHandler = class GPlusHandler extends CocoClass @saveIfAllDone() saveIfAllDone: => + console.debug 'Save if all done. Person loaded:', @personLoaded, 'and email loaded:', @emailLoaded return unless @personLoaded and @emailLoaded + console.debug 'Email, gplusID:', me.get('email'), me.get('gplusID') return unless me.get('email') and me.get('gplusID') Backbone.Mediator.publish 'auth:logging-in-with-gplus', {} @@ -104,12 +106,16 @@ module.exports = GPlusHandler = class GPlusHandler extends CocoClass patch.email = me.get('email') wasAnonymous = me.get('anonymous') @trigger 'logging-into-codecombat' + console.debug('Logging into GPlus.') me.save(patch, { patch: true type: 'PUT' - error: backboneFailure, + error: -> + console.debug('Logging into GPlus fail.', arguments) + backboneFailure(arguments...) url: "/db/user?gplusID=#{gplusID}&gplusAccessToken=#{@accessToken.access_token}" success: (model) -> + console.debug('GPLus login success!') window.location.reload() if wasAnonymous and not model.get('anonymous') }) diff --git a/app/views/modal/AuthModal.coffee b/app/views/modal/AuthModal.coffee index 5ae45badc..aa4c25cad 100644 --- a/app/views/modal/AuthModal.coffee +++ b/app/views/modal/AuthModal.coffee @@ -126,8 +126,6 @@ module.exports = class AuthModal extends ModalView step.done = false for step in @gplusAuthSteps handler = application.gplusHandler - @renderGPlusAuthChecklist() - @listenToOnce handler, 'logged-in', -> @gplusAuthSteps[0].done = true @renderGPlusAuthChecklist()