0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 17:03:50 +01:00

Guess the home server URL on the login screen by inspecting the URL of the web client.

This commit is contained in:
Kegan Dougal 2014-08-14 13:57:55 +01:00
parent 61933f8e52
commit 613e468b89

View file

@ -3,8 +3,16 @@ angular.module('LoginController', ['matrixService'])
function($scope, $location, matrixService) { function($scope, $location, matrixService) {
'use strict'; 'use strict';
// Assume that this is hosted on the home server, in which case the URL
// contains the home server.
var hs_url = $location.protocol() + "://" + $location.host();
if ($location.port()) {
hs_url += ":" + $location.port();
}
$scope.account = { $scope.account = {
homeserver: "http://localhost:8080", homeserver: hs_url,
desired_user_name: "", desired_user_name: "",
user_id: "", user_id: "",
password: "", password: "",