Green user sign in flow

This commit is contained in:
2014-12-24 09:34:05 +01:00
parent a30b17648d
commit 4faee9aa6e
6 changed files with 126 additions and 37 deletions
@@ -99,10 +99,12 @@ App.ApplicationController = Ember.Controller.extend
error = @ajaxError (emberError)=>
# if jqXHR.status == 404 officially, now assume close list on error
#@redirect_to 'index', message: 'the_list_has_been_closed'
console.log "Error: #{emberError.message}" if emberError.message
#console.log "Error: #{emberError.message}" if emberError.message
if error_list = @store.all('list').findBy('id', 'current')
error_list.eraseRecord()
@set 'list', null
@redirect_to 'index'
@store.find('list', 'current').then(success, error)
didInsertElement: (e)->
#debugger
@@ -20,8 +20,9 @@ App.ApplicationRoute = Ember.Route.extend
Qstorage.setItem 'user_id', user_id
Qstorage.setItem 'auth_token', auth_token
controller = @controllerFor('application')
controller.setCurrentList()
controller.set 'notice', t('messages.authenticated')
controller.setCurrentList ->
@transitionTo('active_list')
controller.set 'notice', t('messages.authenticated')
actions:
obtain_token: ( options = {} ) ->
provider = options.provider || 'facebook'