mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
89f0f52714
2 changed files with 7 additions and 3 deletions
|
@ -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')
|
||||
})
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue