2016-03-18 23:03:28 +01:00
|
|
|
app.config(function ($stateProvider, $urlRouterProvider, $locationProvider, $couchPotatoProvider) {
|
2016-03-28 19:28:26 +02:00
|
|
|
$stateProvider.state('auth', {
|
|
|
|
url: '/auth',
|
|
|
|
abstract: true,
|
|
|
|
templateUrl: '/tpl/abstract.html'
|
|
|
|
})
|
|
|
|
.state('auth.login', {
|
2016-03-19 00:23:03 +01:00
|
|
|
url: '/login',
|
2016-03-18 23:03:28 +01:00
|
|
|
pageTitle: "Sign In",
|
2016-03-28 19:28:26 +02:00
|
|
|
templateUrl: '/tpl/auth/login.html',
|
2016-03-18 23:03:28 +01:00
|
|
|
controller: "SignInCtrl",
|
|
|
|
resolve: {
|
2016-03-28 19:28:26 +02:00
|
|
|
$d: $couchPotatoProvider.resolveDependencies(['controllers/auth/login'])
|
2016-03-18 23:03:28 +01:00
|
|
|
}
|
|
|
|
})
|
2016-03-28 19:28:26 +02:00
|
|
|
.state('auth.logout', {
|
|
|
|
url: '/logout',
|
|
|
|
public: true,
|
|
|
|
templateUrl: '/tpl/auth/logout.html',
|
|
|
|
controller: ['$http', '$rootScope', '$state', function ($http, $rootScope, $state) {
|
|
|
|
$http.post('/auth/logout').success(function () {
|
|
|
|
$rootScope.refreshUser();
|
|
|
|
$state.go('auth.login');
|
|
|
|
});
|
|
|
|
}]
|
|
|
|
});
|
2016-03-18 23:03:28 +01:00
|
|
|
});
|