1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-07 21:23:00 +03:00

Clean up the MatrixChat initSession code (#11403)

`async` functions are a thing, and they make this much more comprehensible.
This commit is contained in:
Richard van der Hoff
2023-08-14 13:52:08 +01:00
committed by GitHub
parent f65c6726c9
commit 672ad98ec7
4 changed files with 223 additions and 50 deletions

View File

@@ -204,6 +204,7 @@ export async function attemptDelegatedAuthLogin(
fragmentAfterLogin?: string,
): Promise<boolean> {
if (queryParams.code && queryParams.state) {
console.log("We have OIDC params - attempting OIDC login");
return attemptOidcNativeLogin(queryParams);
}
@@ -297,6 +298,8 @@ export function attemptTokenLogin(
return Promise.resolve(false);
}
console.log("We have token login params - attempting token login");
const homeserver = localStorage.getItem(SSO_HOMESERVER_URL_KEY);
const identityServer = localStorage.getItem(SSO_ID_SERVER_URL_KEY) ?? undefined;
if (!homeserver) {