sahat/satellizer

View on GitHub
examples/client/controllers/logout.js

Summary

Maintainability
A
2 hrs
Test Coverage
angular.module('MyApp')
  .controller('LogoutCtrl', function($location, $auth, toastr) {
    if (!$auth.isAuthenticated()) { return; }
    $auth.logout()
      .then(function() {
        toastr.info('You have been logged out');
        $location.path('/');
      });
  });