Extend from a Signup class to keep hs/is URL logic together

pull/21833/head
Kegan Dougal 2015-11-17 17:25:14 +00:00
parent 257a65de14
commit 0f34f8b494
1 changed files with 34 additions and 5 deletions

View File

@ -3,14 +3,43 @@ var MatrixClientPeg = require("./MatrixClientPeg");
var dis = require("./dispatcher");
var q = require("q");
class Register {
}
class Login {
class Signup {
constructor(hsUrl, isUrl) {
this._hsUrl = hsUrl;
this._isUrl = isUrl;
}
getHomeserverUrl() {
return this._hsUrl;
}
getIdentityServerUrl() {
return this._isUrl;
}
setHomeserverUrl(hsUrl) {
this._hsUrl = hsUrl;
}
setIdentityServerUrl(isUrl) {
this._isUrl = isUrl;
}
}
class Register extends Signup {
constructor(hsUrl, isUrl) {
super(hsUrl, isUrl);
this._state = "start";
}
getState() {
return this._state;
}
}
class Login extends Signup {
constructor(hsUrl, isUrl) {
super(hsUrl, isUrl);
this._currentFlowIndex = 0;
this._flows = [];
}