Green user sign in flow
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -290,7 +290,7 @@ class UserController < Users::ApplicationController
|
||||
#end
|
||||
|
||||
def obtain_token
|
||||
redirect_to user_omniauth_authorize_path('facebook') and return unless current_user.present?
|
||||
redirect_to user_omniauth_authorize_path(params[:provider].presence || 'facebook') and return unless current_user.present?
|
||||
# redirect_to case platform
|
||||
# when 'android' then "file:///android_asset/user/index.html?user_id=#{current_user.id}&auth_token=#{current_user.authentication_token}"
|
||||
# when
|
||||
|
||||
Reference in New Issue
Block a user