mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 14:07:55 +01:00
Closes #216: redirect to login if not connected
This commit is contained in:
parent
cbb8d4e1b6
commit
d2256eabfa
@ -5,7 +5,11 @@
|
|||||||
*/
|
*/
|
||||||
angular.module('docs').controller('Main', function($scope, $rootScope, $state, User) {
|
angular.module('docs').controller('Main', function($scope, $rootScope, $state, User) {
|
||||||
User.userInfo().then(function(data) {
|
User.userInfo().then(function(data) {
|
||||||
if (!data.anonymous) {
|
if (data.anonymous) {
|
||||||
|
$state.go('login', {}, {
|
||||||
|
location: 'replace'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
$state.go('document.default', {}, {
|
$state.go('document.default', {}, {
|
||||||
location: 'replace'
|
location: 'replace'
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user