forked from mystiq/hydrogen-web
Make LoginMethod an interface
This commit is contained in:
parent
93abbe83e8
commit
91f2a96403
3 changed files with 7 additions and 14 deletions
|
@ -14,17 +14,10 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export class LoginMethod {
|
import type {ILogItem} from "../../logging/types";
|
||||||
constructor({homeserver}) {
|
import type {HomeServerApi} from "../net/HomeServerApi.js";
|
||||||
this.homeserver = homeserver;
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
export interface ILoginMethod {
|
||||||
async login(hsApi, deviceName, log) {
|
homeserver: string;
|
||||||
/*
|
login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Response["body"];
|
||||||
Regardless of the login method, SessionContainer.startWithLogin()
|
|
||||||
can do SomeLoginMethod.login()
|
|
||||||
*/
|
|
||||||
throw("Not Implemented");
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {LoginMethod} from "./LoginMethod.js";
|
import {LoginMethod} from "./LoginMethod";
|
||||||
|
|
||||||
export class PasswordLoginMethod extends LoginMethod {
|
export class PasswordLoginMethod extends LoginMethod {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {LoginMethod} from "./LoginMethod.js";
|
import {LoginMethod} from "./LoginMethod";
|
||||||
import {makeTxnId} from "../common.js";
|
import {makeTxnId} from "../common.js";
|
||||||
|
|
||||||
export class TokenLoginMethod extends LoginMethod {
|
export class TokenLoginMethod extends LoginMethod {
|
||||||
|
|
Loading…
Reference in a new issue