Sorry for reposting this issue but I was unable to reply to post I found to
ask for a fix.

I have a login controller which actually does login the user just fine. but
requires a page refresh to show tht the use is logged in... logging out
updates the UI just fine... loggin in does not.

Here is the controller I am using... this is one of many iterations so far
to get his working. ANY help is appreciated

.controller('LoginCtrl', function($scope, $timeout, $ionicModal, Auth) {

    // Auth
      $scope.auth = Auth;

   $scope.user = $scope.auth.$getAuth();

    $scope.login = function(provider) {

        $scope.auth.$authWithOAuthPopup(provider, function(error, authData) {

            $scope.$apply(function() {

                $scope.user = authData.auth.$getAuth();

            });

        });

    };

    $scope.logout = function() {

        $scope.auth.$unauth();

        $scope.user = $scope.auth.$getAuth();

    };

})


--
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/5f32358b-98cf-4c82-bfa8-f82f5b55c1c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Jacob Wenger at Jan 4, 2015 at 8:37 pm
    A nearly identical question is answered here
    <https://groups.google.com/forum/#!topic/firebase-angular/uoFkZTnHBZg>.
    Short answer: this should be fixed with the upcoming AngularFire 0.9.1
    release.

    Jacob
    On Saturday, January 3, 2015 6:25:10 PM UTC-5, Justin Bane wrote:

    Sorry for reposting this issue but I was unable to reply to post I found
    to ask for a fix.

    I have a login controller which actually does login the user just fine.
    but requires a page refresh to show tht the use is logged in... logging out
    updates the UI just fine... loggin in does not.

    Here is the controller I am using... this is one of many iterations so far
    to get his working. ANY help is appreciated

    .controller('LoginCtrl', function($scope, $timeout, $ionicModal, Auth) {

    // Auth
    $scope.auth = Auth;

    $scope.user = $scope.auth.$getAuth();

    $scope.login = function(provider) {

    $scope.auth.$authWithOAuthPopup(provider, function(error, authData)
    {

    $scope.$apply(function() {

    $scope.user = authData.auth.$getAuth();

    });

    });

    };

    $scope.logout = function() {

    $scope.auth.$unauth();

    $scope.user = $scope.auth.$getAuth();

    };

    })

    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/542ab217-eb4d-45ed-b649-d69f96380be2%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Justin Bane at Jan 5, 2015 at 6:49 pm
    Thanks Jacob,

    In case someone was looking for an example of the work around - this is
    working well for me in my login controller.

    // Auth
    $scope.auth = Auth;
    $scope.user = $scope.auth.$getAuth();

    $scope.login = function(provider) {
         $scope.auth.$authWithOAuthPopup(provider);
    };

    $scope.auth.$onAuth(function() {
         $scope.user = $scope.auth.$getAuth();
         $timeout(function() {
            $scope.$apply();
         }, 500);
    });

    $scope.logout = function() {
         $scope.auth.$unauth();
         $scope.user = $scope.auth.$getAuth();
    };

    Thanks again, sorry next time I'll search a bit more :)

    On Sunday, January 4, 2015 12:37:20 PM UTC-8, Jacob Wenger wrote:

    A nearly identical question is answered here
    <https://groups.google.com/forum/#!topic/firebase-angular/uoFkZTnHBZg>.
    Short answer: this should be fixed with the upcoming AngularFire 0.9.1
    release.

    Jacob
    On Saturday, January 3, 2015 6:25:10 PM UTC-5, Justin Bane wrote:

    Sorry for reposting this issue but I was unable to reply to post I found
    to ask for a fix.

    I have a login controller which actually does login the user just fine.
    but requires a page refresh to show tht the use is logged in... logging out
    updates the UI just fine... loggin in does not.

    Here is the controller I am using... this is one of many iterations so
    far to get his working. ANY help is appreciated

    .controller('LoginCtrl', function($scope, $timeout, $ionicModal, Auth) {

    // Auth
    $scope.auth = Auth;

    $scope.user = $scope.auth.$getAuth();

    $scope.login = function(provider) {

    $scope.auth.$authWithOAuthPopup(provider, function(error, authData
    ) {

    $scope.$apply(function() {

    $scope.user = authData.auth.$getAuth();

    });

    });

    };

    $scope.logout = function() {

    $scope.auth.$unauth();

    $scope.user = $scope.auth.$getAuth();

    };

    })

    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/30c83e0e-f287-4d07-93bb-0e4555f446bc%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedJan 4, '15 at 8:25p
activeJan 5, '15 at 6:49p
posts3
users2

2 users in discussion

Justin Bane: 2 posts Jacob Wenger: 1 post

People

Translate

site design / logo © 2021 Grokbase