mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-03 01:14:46 -04:00
Added some logs to figure out why that one time the GPlus logging in process just left things hanging.
This commit is contained in:
parent
41db27c709
commit
e10af778ca
2 changed files with 7 additions and 3 deletions
app
|
@ -91,7 +91,9 @@ module.exports = GPlusHandler = class GPlusHandler extends CocoClass
|
||||||
@saveIfAllDone()
|
@saveIfAllDone()
|
||||||
|
|
||||||
saveIfAllDone: =>
|
saveIfAllDone: =>
|
||||||
|
console.debug 'Save if all done. Person loaded:', @personLoaded, 'and email loaded:', @emailLoaded
|
||||||
return unless @personLoaded and @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')
|
return unless me.get('email') and me.get('gplusID')
|
||||||
|
|
||||||
Backbone.Mediator.publish 'auth:logging-in-with-gplus', {}
|
Backbone.Mediator.publish 'auth:logging-in-with-gplus', {}
|
||||||
|
@ -104,12 +106,16 @@ module.exports = GPlusHandler = class GPlusHandler extends CocoClass
|
||||||
patch.email = me.get('email')
|
patch.email = me.get('email')
|
||||||
wasAnonymous = me.get('anonymous')
|
wasAnonymous = me.get('anonymous')
|
||||||
@trigger 'logging-into-codecombat'
|
@trigger 'logging-into-codecombat'
|
||||||
|
console.debug('Logging into GPlus.')
|
||||||
me.save(patch, {
|
me.save(patch, {
|
||||||
patch: true
|
patch: true
|
||||||
type: 'PUT'
|
type: 'PUT'
|
||||||
error: backboneFailure,
|
error: ->
|
||||||
|
console.debug('Logging into GPlus fail.', arguments)
|
||||||
|
backboneFailure(arguments...)
|
||||||
url: "/db/user?gplusID=#{gplusID}&gplusAccessToken=#{@accessToken.access_token}"
|
url: "/db/user?gplusID=#{gplusID}&gplusAccessToken=#{@accessToken.access_token}"
|
||||||
success: (model) ->
|
success: (model) ->
|
||||||
|
console.debug('GPLus login success!')
|
||||||
window.location.reload() if wasAnonymous and not model.get('anonymous')
|
window.location.reload() if wasAnonymous and not model.get('anonymous')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -126,8 +126,6 @@ module.exports = class AuthModal extends ModalView
|
||||||
step.done = false for step in @gplusAuthSteps
|
step.done = false for step in @gplusAuthSteps
|
||||||
handler = application.gplusHandler
|
handler = application.gplusHandler
|
||||||
|
|
||||||
@renderGPlusAuthChecklist()
|
|
||||||
|
|
||||||
@listenToOnce handler, 'logged-in', ->
|
@listenToOnce handler, 'logged-in', ->
|
||||||
@gplusAuthSteps[0].done = true
|
@gplusAuthSteps[0].done = true
|
||||||
@renderGPlusAuthChecklist()
|
@renderGPlusAuthChecklist()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue