Apply strictNullChecks to src/components/auth/* (#10484

* Apply `strictNullChecks` to `src/components/auth/*`

* fix

* strict types
This commit is contained in:
Michael Telatynski
2023-03-31 09:26:15 +01:00
committed by GitHub
parent af151700c9
commit f152613f83
8 changed files with 25 additions and 17 deletions

View File

@@ -164,7 +164,7 @@ export default class Login {
*/
export async function sendLoginRequest(
hsUrl: string,
isUrl: string,
isUrl: string | undefined,
loginType: string,
loginParams: ILoginParams,
): Promise<IMatrixClientCreds> {
@@ -177,11 +177,11 @@ export async function sendLoginRequest(
const wellknown = data.well_known;
if (wellknown) {
if (wellknown["m.homeserver"] && wellknown["m.homeserver"]["base_url"]) {
if (wellknown["m.homeserver"]?.["base_url"]) {
hsUrl = wellknown["m.homeserver"]["base_url"];
logger.log(`Overrode homeserver setting with ${hsUrl} from login response`);
}
if (wellknown["m.identity_server"] && wellknown["m.identity_server"]["base_url"]) {
if (wellknown["m.identity_server"]?.["base_url"]) {
// TODO: should we prompt here?
isUrl = wellknown["m.identity_server"]["base_url"];
logger.log(`Overrode IS setting with ${isUrl} from login response`);