(function() {
    'use strict';
    
    angular
        .module('lecturer')
        .config(config);

    /* ngInject */
    function config($routeProvider, $httpProvider) {
        console.log('Ready (Providers)');
        
        $routeProvider
            .when('/', {
                templateUrl: 'app/login/login.html',
                controller: 'LoginCtrl',
                controllerAs: 'vm',
                loginRequired: false
            })
            .when('/register', {
                templateUrl: 'app/register/register.html',
                controller: 'RegisterCtrl',
                controllerAs: 'vm',
                loginRequired: false
            })
            .when('/courses', {
                templateUrl: 'app/courses/courses.html',
                controller: 'CoursesCtrl',
                controllerAs: 'vm',
                loginRequired: true
            })
            .when('/lectures', {
                templateUrl: 'app/lectures/lectures.html',
                controller: 'LecturesCtrl',
                controllerAs: 'vm',
                loginRequired: true
            })
            .when('/lectures/:lectureId', {
                templateUrl: 'app/lecture/lecture.html',
                controller: 'LectureCtrl',
                controllerAs: 'vm'
            })
            .otherwise({
                redirectTo: '/'
            });

        $httpProvider.interceptors.push('apiInterceptor');
    }
})();

(function() {
    'use strict';
    
    angular
        .module('lecturer')
        .config(config);

    /* ngInject */
    function config($routeProvider, $httpProvider) {
        console.log('Ready (Providers)');
        
        $routeProvider
            .when('/', {
                templateUrl: 'app/login/login.html',
                controller: 'LoginCtrl',
                controllerAs: 'vm',
                loginRequired: false
            })
            .when('/register', {
                templateUrl: 'app/register/register.html',
                controller: 'RegisterCtrl',
                controllerAs: 'vm',
                loginRequired: false
            })
            .when('/courses', {
                templateUrl: 'app/courses/courses.html',
                controller: 'CoursesCtrl',
                controllerAs: 'vm',
                loginRequired: true
            })
            .when('/lectures', {
                templateUrl: 'app/lectures/lectures.html',
                controller: 'LecturesCtrl',
                controllerAs: 'vm',
                loginRequired: true
            })
            .when('/lectures/:lectureId', {
                templateUrl: 'app/lecture/lecture.html',
                controller: 'LectureCtrl',
                controllerAs: 'vm',
                loginRequired: true
            })
            .otherwise({
                redirectTo: '/'
            });

        $httpProvider.interceptors.push('apiInterceptor');
    }
})();

Fix lecturer lecture page being accessible to everyone
Fix lecturer lecture page being accessible to everyone
