diff --git a/webclient/login/login-controller.js b/webclient/login/login-controller.js
index 53756be9ea3eb6fc2c98967494cddd098b6287d5..826a533873fe0c741080e638a81ae5b35f40bd06 100644
--- a/webclient/login/login-controller.js
+++ b/webclient/login/login-controller.js
@@ -68,6 +68,12 @@ angular.module('LoginController', ['matrixService'])
     };
 
     $scope.login = function() {
+        if ($scope.account.user_id.indexOf("@") !== 0) {
+            // technically should be the host of account.homeserver
+            $scope.account.user_id = "@" + $scope.account.user_id + ":" + 
+                                     $location.host()
+        }
+    
         matrixService.setConfig({
             homeserver: $scope.account.homeserver,
             user_id: $scope.account.user_id