javascript - Ember.js authentication action not working -
This is my first time using ember.js when a user successfully executes (authenticated) an action I'm trying to use a controller. However, my current method of saving the user's status or even the asset is changing 'this.set (' userSignedIn ', state);' Not working. I'm not sure why, I'm guessing that this is to be done with the scope of my 'state' variable, or maybe the 'this' object is not being sent to 'ref.auth.WithOAuthPopup ()'. I am hoping that someone can point in the right direction.
var ref = new firefighter ("https: // Firebaseio.com"); Var state = wrong; MyApp.ApplicationController = Ember.Controller.extend ({userSignedIn: false, verbs: {signin: function () {ref.authWithOAuthPopup ("facebook", function (error, authData) {if (error) {console.log ("login State of truth =};}}; this.set ('user.signedIn', state); console.log (state);}, // signin end}};
You set Firebase.authWithOAuthPopup before Instead, try it: userSignedIn (provider, complete, [option] ) The complete callback has been removed.
signin: function () {controllerContext = this; Ref.authWithOAuthPopup ("facebook", function (error , AuthData) {if (error) {console.log ("login failed!", Error);} else {console.log ("successfully authenticated with payload: authData); state = true; controller context. ('User sign in', state); console.log (state);}});}, // end of signin
Comments
Post a Comment