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.
|
||||
*/
|
||||
|
||||
export class LoginMethod {
|
||||
constructor({homeserver}) {
|
||||
this.homeserver = homeserver;
|
||||
}
|
||||
import type {ILogItem} from "../../logging/types";
|
||||
import type {HomeServerApi} from "../net/HomeServerApi.js";
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
async login(hsApi, deviceName, log) {
|
||||
/*
|
||||
Regardless of the login method, SessionContainer.startWithLogin()
|
||||
can do SomeLoginMethod.login()
|
||||
*/
|
||||
throw("Not Implemented");
|
||||
}
|
||||
export interface ILoginMethod {
|
||||
homeserver: string;
|
||||
login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Response["body"];
|
||||
}
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import {LoginMethod} from "./LoginMethod.js";
|
||||
import {LoginMethod} from "./LoginMethod";
|
||||
|
||||
export class PasswordLoginMethod extends LoginMethod {
|
||||
constructor(options) {
|
||||
|
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import {LoginMethod} from "./LoginMethod.js";
|
||||
import {LoginMethod} from "./LoginMethod";
|
||||
import {makeTxnId} from "../common.js";
|
||||
|
||||
export class TokenLoginMethod extends LoginMethod {
|
||||
|
|
Reference in a new issue