fix(android): redirect to root on logout to dodge Capacitor SPA-fallback failure on URL-encoded path segments
This commit is contained in:
parent
c31e9a6e92
commit
c243495d4e
1 changed files with 7 additions and 1 deletions
|
|
@ -102,7 +102,13 @@ export const logoutClient = async (mx: MatrixClient) => {
|
|||
}
|
||||
await mx.clearStores();
|
||||
window.localStorage.clear();
|
||||
window.location.reload();
|
||||
// Navigate to root instead of reload(): on Android Capacitor the
|
||||
// WebViewLocalServer fails to SPA-fallback on URLs with `%3A` in path
|
||||
// segments (Matrix room/space ids), so reload of `/<spaceId>/<roomId>/`
|
||||
// or `/channels/<spaceId>/...` returns ERR_HTTP_RESPONSE_CODE_FAILURE.
|
||||
// Replacing to `/` always resolves to index.html; the Router index
|
||||
// loader then redirects to the login page since the session is gone.
|
||||
window.location.replace('/');
|
||||
};
|
||||
|
||||
export const clearLoginData = async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue