feat: URL navigation in auth (#1603)
authorAjay Bura <32841439+ajbura@users.noreply.github.com>
Sun, 21 Jan 2024 12:50:56 +0000 (23:50 +1100)
committerGitHub <noreply@github.com>
Sun, 21 Jan 2024 12:50:56 +0000 (18:20 +0530)
commit20db27fa7ef1cbb9682780ecb4dbdf96cc4540ec
tree06b8d14d4e242cc9c25e29156cd8ec8b7eea892a
parentbb88eb715484ffb46b9e56368f1d92651dc4c6bb
feat: URL navigation in auth (#1603)

* bump to react 18 and install react-router-dom

* Upgrade to react 18 root

* update vite

* add cs api's

* convert state/auth to ts

* add client config context

* add auto discovery context

* add spec version context

* add auth flow context

* add background dot pattern css

* add promise utils

* init url based routing

* update auth route server path as effect

* add auth server hook

* always use server from discovery info in context

* login - WIP

* upgrade jotai to v2

* add atom with localStorage util

* add multi account sessions atom

* add default IGNORE res to auto discovery

* add error type in async callback hook

* handle password login error

* fix async callback hook

* allow password login

* Show custom server not allowed error in mxId login

* add sso login component

* add token login

* fix hardcoded m.login.password in login func

* update server input on url change

* Improve sso login labels

* update folds

* fix async callback batching state update in safari

* wrap async callback set state in queueMicrotask

* wip

* wip - register

* arrange auth file structure

* add error codes

* extract filed error component form password login

* add register util function

* handle register flow - WIP

* update unsupported auth flow method reasons

* improve password input styles

* Improve UIA flow next stage calculation
complete stages can have any order so we will look for first stage which is not in completed

* process register UIA flow stages

* Extract register UIA stages component

* improve register error messages

* add focus trap & step count in UIA stages

* add reset password path and path utils

* add path with origin hook

* fix sso redirect url

* rename register token query param to token

* restyle auth screen header

* add reset password component - WIP

* add reset password form

* add netlify rewrites

* fix netlify file indentation

* test netlify redirect

* fix vite to include netlify toml

* add more netlify redirects

* add splat to public and assets path

* fix vite base name

* add option to use hash router in config and remove appVersion

* add splash screen component

* add client config loading and error screen

* fix server picker bug

* fix reset password email input type

* make auth page small screen responsive

* fix typo in reset password screen
104 files changed:
_redirects [deleted file]
build.config.ts [new file with mode: 0644]
config.json
index.html
netlify.toml [new file with mode: 0644]
package-lock.json
package.json
src/app/components/AuthFlowsLoader.tsx [new file with mode: 0644]
src/app/components/ClientConfigLoader.tsx [new file with mode: 0644]
src/app/components/ConfirmPasswordMatch.tsx [new file with mode: 0644]
src/app/components/SpecVersionsLoader.tsx [new file with mode: 0644]
src/app/components/SupportedUIAFlowsLoader.tsx [new file with mode: 0644]
src/app/components/UIAFlowOverlay.tsx [new file with mode: 0644]
src/app/components/password-input/PasswordInput.tsx [new file with mode: 0644]
src/app/components/splash-screen/SplashScreen.css.ts [new file with mode: 0644]
src/app/components/splash-screen/SplashScreen.tsx [new file with mode: 0644]
src/app/components/splash-screen/index.ts [new file with mode: 0644]
src/app/components/uia-stages/DummyStage.tsx [new file with mode: 0644]
src/app/components/uia-stages/EmailStage.tsx [new file with mode: 0644]
src/app/components/uia-stages/ReCaptchaStage.tsx [new file with mode: 0644]
src/app/components/uia-stages/RegistrationTokenStage.tsx [new file with mode: 0644]
src/app/components/uia-stages/TermsStage.tsx [new file with mode: 0644]
src/app/components/uia-stages/index.ts [new file with mode: 0644]
src/app/components/uia-stages/types.ts [new file with mode: 0644]
src/app/cs-api.ts [new file with mode: 0644]
src/app/cs-errorcode.ts [new file with mode: 0644]
src/app/hooks/types.ts [new file with mode: 0644]
src/app/hooks/useAsyncCallback.ts
src/app/hooks/useAuthFlows.ts [new file with mode: 0644]
src/app/hooks/useAuthServer.ts [new file with mode: 0644]
src/app/hooks/useAutoDiscoveryInfo.ts [new file with mode: 0644]
src/app/hooks/useClientConfig.ts [new file with mode: 0644]
src/app/hooks/useCrossSigningStatus.js
src/app/hooks/useParsedLoginFlows.ts [new file with mode: 0644]
src/app/hooks/usePasswordEmail.ts [new file with mode: 0644]
src/app/hooks/usePathWithOrigin.ts [new file with mode: 0644]
src/app/hooks/useRegisterEmail.ts [new file with mode: 0644]
src/app/hooks/useSpecVersions.ts [new file with mode: 0644]
src/app/hooks/useUIAFlows.ts [new file with mode: 0644]
src/app/molecules/room-aliases/RoomAliases.jsx
src/app/molecules/room-history-visibility/RoomHistoryVisibility.jsx
src/app/molecules/room-notification/RoomNotification.jsx
src/app/molecules/room-search/RoomSearch.jsx
src/app/molecules/room-visibility/RoomVisibility.jsx
src/app/organisms/emoji-verification/EmojiVerification.jsx
src/app/organisms/room/message/UrlPreviewCard.tsx
src/app/organisms/space-manage/SpaceManage.jsx
src/app/pages/App.jsx [deleted file]
src/app/pages/App.tsx [new file with mode: 0644]
src/app/pages/ConfigConfig.tsx [new file with mode: 0644]
src/app/pages/auth/AuthFooter.tsx [new file with mode: 0644]
src/app/pages/auth/AuthLayout.tsx [new file with mode: 0644]
src/app/pages/auth/FiledError.tsx [new file with mode: 0644]
src/app/pages/auth/OrDivider.tsx [new file with mode: 0644]
src/app/pages/auth/SSOLogin.tsx [new file with mode: 0644]
src/app/pages/auth/ServerPicker.tsx [new file with mode: 0644]
src/app/pages/auth/index.ts [new file with mode: 0644]
src/app/pages/auth/login/Login.tsx [new file with mode: 0644]
src/app/pages/auth/login/PasswordLoginForm.tsx [new file with mode: 0644]
src/app/pages/auth/login/TokenLogin.tsx [new file with mode: 0644]
src/app/pages/auth/login/index.ts [new file with mode: 0644]
src/app/pages/auth/login/loginUtil.ts [new file with mode: 0644]
src/app/pages/auth/register/PasswordRegisterForm.tsx [new file with mode: 0644]
src/app/pages/auth/register/Register.tsx [new file with mode: 0644]
src/app/pages/auth/register/index.ts [new file with mode: 0644]
src/app/pages/auth/register/registerUtil.ts [new file with mode: 0644]
src/app/pages/auth/reset-password/PasswordResetForm.tsx [new file with mode: 0644]
src/app/pages/auth/reset-password/ResetPassword.tsx [new file with mode: 0644]
src/app/pages/auth/reset-password/index.ts [new file with mode: 0644]
src/app/pages/auth/reset-password/resetPasswordUtil.ts [new file with mode: 0644]
src/app/pages/auth/styles.css.ts [new file with mode: 0644]
src/app/pages/pathUtils.ts [new file with mode: 0644]
src/app/pages/paths.ts [new file with mode: 0644]
src/app/state/hooks/inviteList.ts
src/app/state/hooks/roomList.ts
src/app/state/hooks/settings.ts
src/app/state/inviteList.ts
src/app/state/list.ts
src/app/state/mDirectList.ts
src/app/state/mutedRoomList.ts
src/app/state/roomList.ts
src/app/state/roomToParents.ts
src/app/state/roomToUnread.ts
src/app/state/sessions.ts [new file with mode: 0644]
src/app/state/settings.ts
src/app/state/tabToRoom.ts
src/app/state/typingMembers.ts
src/app/state/upload.ts
src/app/state/utils.ts
src/app/state/utils/atomWithLocalStorage.ts [new file with mode: 0644]
src/app/styles/Patterns.css.ts [new file with mode: 0644]
src/app/utils/common.ts
src/app/utils/matrix-uia.ts [new file with mode: 0644]
src/app/utils/regex.ts
src/client/action/auth.js
src/client/initMatrix.js
src/client/state/auth.js [deleted file]
src/client/state/auth.ts [new file with mode: 0644]
src/ext.d.ts
src/index.jsx [deleted file]
src/index.tsx [new file with mode: 0644]
src/types/utils.ts [new file with mode: 0644]
tsconfig.json
vite.config.js