You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Fixes user authentication when registering via the module API (#10257)
* Fixes authentication when user is registered via module API * Remove "on_logging_in" action --------- Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net> Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
This commit is contained in:
@@ -568,7 +568,7 @@ export async function hydrateSession(credentials: IMatrixClientCreds): Promise<M
|
||||
}
|
||||
|
||||
/**
|
||||
* fires on_logging_in, optionally clears localstorage, persists new credentials
|
||||
* optionally clears localstorage, persists new credentials
|
||||
* to localstorage, starts the new client.
|
||||
*
|
||||
* @param {IMatrixClientCreds} credentials
|
||||
@@ -595,15 +595,6 @@ async function doSetLoggedIn(credentials: IMatrixClientCreds, clearStorageEnable
|
||||
" freshLogin: " + credentials.freshLogin,
|
||||
);
|
||||
|
||||
// This is dispatched to indicate that the user is still in the process of logging in
|
||||
// because async code may take some time to resolve, breaking the assumption that
|
||||
// `setLoggedIn` takes an "instant" to complete, and dispatch `on_logged_in` a few ms
|
||||
// later than MatrixChat might assume.
|
||||
//
|
||||
// we fire it *synchronously* to make sure it fires before on_logged_in.
|
||||
// (dis.dispatch uses `window.setTimeout`, which does not guarantee ordering.)
|
||||
dis.dispatch({ action: "on_logging_in" }, true);
|
||||
|
||||
if (clearStorageEnabled) {
|
||||
await clearStorage();
|
||||
}
|
||||
|
Reference in New Issue
Block a user