diff --git a/src/matrix/registration/Registration.ts b/src/matrix/registration/Registration.ts index 9b2c0684..d50cbca5 100644 --- a/src/matrix/registration/Registration.ts +++ b/src/matrix/registration/Registration.ts @@ -28,9 +28,9 @@ import type { type FlowSelector = (flows: RegistrationFlow[]) => RegistrationFlow | void; export class Registration { - private _hsApi: HomeServerApi; - private _accountDetails: AccountDetails; - private _flowSelector: FlowSelector; + private readonly _hsApi: HomeServerApi; + private readonly _accountDetails: AccountDetails; + private readonly _flowSelector: FlowSelector; private _sessionInfo?: RegistrationResponseSuccess constructor(hsApi: HomeServerApi, accountDetails: AccountDetails, flowSelector?: FlowSelector) { @@ -64,7 +64,7 @@ export class Registration { return this.parseRegistrationResponse(registrationResponse, stage); } - parseStagesFromResponse(response: RegistrationResponseMoreDataNeeded): BaseRegistrationStage { + private parseStagesFromResponse(response: RegistrationResponseMoreDataNeeded): BaseRegistrationStage { const { session, params } = response; const flow = this._flowSelector(response.flows); if (!flow) { @@ -89,7 +89,7 @@ export class Registration { return firstStage!; } - async parseRegistrationResponse(response: RegistrationResponse, currentStage: BaseRegistrationStage) { + private async parseRegistrationResponse(response: RegistrationResponse, currentStage: BaseRegistrationStage) { switch (response.status) { case 200: this._sessionInfo = response; diff --git a/src/matrix/registration/stages/BaseRegistrationStage.ts b/src/matrix/registration/stages/BaseRegistrationStage.ts index dfe71fa5..964cc75d 100644 --- a/src/matrix/registration/stages/BaseRegistrationStage.ts +++ b/src/matrix/registration/stages/BaseRegistrationStage.ts @@ -18,11 +18,11 @@ import type {HomeServerApi} from "../../net/HomeServerApi"; import type {AccountDetails, AuthenticationData, RegistrationParams} from "../types"; export abstract class BaseRegistrationStage { - protected _hsApi: HomeServerApi; - protected _accountDetails: AccountDetails; + protected readonly _hsApi: HomeServerApi; + protected readonly _accountDetails: AccountDetails; protected _session: string; protected _nextStage: BaseRegistrationStage; - protected _params?: Record + protected readonly _params?: Record constructor(hsApi: HomeServerApi, accountDetails: AccountDetails, session: string, params?: RegistrationParams) { this._hsApi = hsApi;