thinkster-django-angular icon indicating copy to clipboard operation
thinkster-django-angular copied to clipboard

Authentication.getAuthenticatedAccount() not working

Open rakin92 opened this issue 9 years ago • 0 comments

on account settings controller, it wont let me access the settings page when I am logged in to an account

function activate() {
      var authenticatedAccount = Authentication.getAuthenticatedAccount();
      var username = $routeParams.username.substr(1);
      console.log(authenticatedAccount); // returns undefined
      console.log(username);

      // Redirect if not logged in
      if (!authenticatedAccount) {
        $location.url('/');
        Snackbar.error('You are not authorized to view this page.');
      } else {
        // Redirect if logged in, but not the owner of this account.
        if (authenticatedAccount.username !== username) {
          debugger;
          $location.url('/');
          Snackbar.error('You are not authorized to view this page.');
        }
      }

rakin92 avatar Oct 10 '15 21:10 rakin92