summary refs log tree commit diff
path: root/webclient/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'webclient/app.js')
-rw-r--r--webclient/app.js27
1 files changed, 14 insertions, 13 deletions
diff --git a/webclient/app.js b/webclient/app.js
index 02695c3ae6..dac4f048cd 100644
--- a/webclient/app.js
+++ b/webclient/app.js
@@ -18,6 +18,7 @@ var matrixWebClient = angular.module('matrixWebClient', [
     'ngRoute',
     'MatrixWebClientController',
     'LoginController',
+    'RegisterController',
     'RoomController',
     'HomeController',
     'RecentsController',
@@ -35,30 +36,27 @@ matrixWebClient.config(['$routeProvider', '$provide', '$httpProvider',
     function($routeProvider, $provide, $httpProvider) {
         $routeProvider.
             when('/login', {
-                templateUrl: 'login/login.html',
-                controller: 'LoginController'
+                templateUrl: 'login/login.html'
+            }).
+            when('/register', {
+                templateUrl: 'login/register.html'
             }).
             when('/room/:room_id_or_alias', {
-                templateUrl: 'room/room.html',
-                controller: 'RoomController'
+                templateUrl: 'room/room.html'
             }).
             when('/room/', {    // room URL with room alias in it (ex: http://127.0.0.1:8000/#/room/#public:localhost:8080) will come here.
                                 // The reason is that 2nd hash key breaks routeProvider parameters cutting so that the URL will not match with 
                                 // the previous '/room/:room_id_or_alias' URL rule
-                templateUrl: 'room/room.html',
-                controller: 'RoomController'
+                templateUrl: 'room/room.html'
             }).
             when('/', {
-                templateUrl: 'home/home.html',
-                controller: 'HomeController'
+                templateUrl: 'home/home.html'
             }).
             when('/settings', {
-                templateUrl: 'settings/settings.html',
-                controller: 'SettingsController'
+                templateUrl: 'settings/settings.html'
             }).
             when('/user/:user_matrix_id', {
-                templateUrl: 'user/user.html',
-                controller: 'UserController'
+                templateUrl: 'user/user.html'
             }).
             otherwise({
                 redirectTo: '/'
@@ -84,7 +82,10 @@ matrixWebClient.config(['$routeProvider', '$provide', '$httpProvider',
 matrixWebClient.run(['$location', 'matrixService', function($location, matrixService) {
 
     // If user auth details are not in cache, go to the login page
-    if (!matrixService.isUserLoggedIn()) {
+    if (!matrixService.isUserLoggedIn() &&
+        $location.path() !== "/login" &&
+        $location.path() !== "/register")
+    {
         $location.path("login");
     }