basic authentication stuff
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
App.ApplicationRoute = Ember.Route.extend
|
||||
setupController: (controller)->
|
||||
#@controllerFor('product_orders').set 'model', @store.filter('product_order', (po)-> !po.get('order')) # does not work (yet)
|
||||
debugger
|
||||
@controllerFor('product_orders').set 'model', @store.filter('product_order', (po)-> !po.get('id'))
|
||||
controller.secured ->
|
||||
faye = new Faye.Client(event_host)
|
||||
faye = new Faye.Client($event_host)
|
||||
user_id = Qstorage.getItem('user_id')
|
||||
faye.subscribe "/user/"+user_id, (e)=>
|
||||
console.log e
|
||||
@@ -13,8 +14,7 @@ App.ApplicationRoute = Ember.Route.extend
|
||||
unauthorized: ->
|
||||
Qstorage.setItem('auth_token', '')
|
||||
@controllerFor('application').set 'list', null
|
||||
@transitionTo('obtain_token').then =>
|
||||
@controllerFor('application').set('notice', t('messages.unauthorized'))
|
||||
App.obtain_token(t('messages.unauthorized'))
|
||||
actions:
|
||||
openModal: (modalName, model)->
|
||||
@controllerFor(modalName).set('model', model)
|
||||
@@ -33,12 +33,14 @@ App.ApplicationRoute = Ember.Route.extend
|
||||
ok: options.ok
|
||||
listNeedsPayment: ->
|
||||
@get('controller').secured ->
|
||||
$.post(data_host + '/user/list_needs_payment.json', @authentication_object).then (res) =>
|
||||
@set('list.needs_payment', true)
|
||||
Ember.$.post '/user/list_needs_payment.json'
|
||||
#Ember.$.post('/user/list_needs_payment.json').then (res) =>
|
||||
#@set('list.needs_payment', true) # also done by faye
|
||||
listNeedsHelp: ->
|
||||
@get('controller').secured ->
|
||||
$.post(data_host + '/user/needs_help.json', @authentication_object).then (res) =>
|
||||
@set('list.needs_help', true)
|
||||
Ember.$.post '/user/needs_help.json'
|
||||
#Ember.$.post('/user/needs_help.json').then (res) =>
|
||||
#@set('list.needs_help', true) # also done by faye
|
||||
scanQr: ->
|
||||
@transitionTo 'select_qrcode'
|
||||
events: ->
|
||||
|
||||
Reference in New Issue
Block a user