0
試圖掛鉤我的應用程序的Facebook認證。我有後端正常工作,但我的身份驗證(我認爲這是問題)總是返回undefined
。ember-simple-auth臉書認證器
從ember-simple-auth複製範例從第23行控制檯登錄是不會被調用,讓我覺得別的什麼問題?
import Ember from 'ember';
import Torii from 'ember-simple-auth/authenticators/torii';
const {inject: {service}} = Ember;
export default Torii.extend({
torii: service(),
ajax: service(),
authenticate() {
const ajax = this.get('ajax');
return this._super(...arguments).then((data) => {
return ajax.request('http://localhost:8080/api/login', {
type: 'POST',
dataType: 'application/json',
data: {
'grant_type': 'facebook_auth_code',
'auth_code': data.authorizationCode
}
}).then((response) => {
console.log("CALLED!");
return {
access_token: response,
provider: data.provider
};
});
});
}
});
服務器的響應是來自facebook的access_token;
我該如何更好地調試/解決這裏發生的事情?