logto-io / logto

🧑‍🚀 The better identity infrastructure for developers and the open-source alternative to Auth0.
https://logto.io
Mozilla Public License 2.0
7.79k stars 383 forks source link

refactor(experience): cache user input identifier for a better sign-in experience #6164

Open xiaoyijun opened 5 days ago

xiaoyijun commented 5 days ago

Summary

This PR introduces a significant refactoring of the user input identifier caching mechanism to enhance the sign-in experience. The main changes include:

These changes aim to provide a more seamless and consistent experience for users across different authentication flows, reducing the need for re-entering information and improving overall usability.

The refactoring touches multiple files across the experience package, primarily focusing on state management and data persistence between different steps of the authentication process.

Testing

Test locally and all IT passed.

Checklist

github-actions[bot] commented 5 days ago

COMPARE TO master

Total Size Diff :chart_with_upwards_trend: +8.35 KB

Diff by File |Name|Diff| |---|---| |packages/experience/src/Providers/UserInteractionContextProvider/UserInteractionContext.tsx|:chart_with_upwards_trend: +1.61 KB| |packages/experience/src/Providers/UserInteractionContextProvider/index.tsx|:chart_with_upwards_trend: +1.46 KB| |packages/experience/src/components/InputFields/SmartInputField/use-smart-input-field.ts|:chart_with_upwards_trend: +233 Bytes| |packages/experience/src/containers/ForgotPasswordLink/index.tsx|:chart_with_upwards_trend: +474 Bytes| |packages/experience/src/containers/VerificationCode/PasswordSignInLink.tsx|:chart_with_upwards_trend: +220 Bytes| |packages/experience/src/containers/VerificationCode/index.tsx|:chart_with_upwards_trend: +36 Bytes| |packages/experience/src/hooks/use-check-single-sign-on.ts|0 Bytes| |packages/experience/src/hooks/use-global-redirect-to.ts|:chart_with_upwards_trend: +510 Bytes| |packages/experience/src/hooks/use-send-verification-code.ts|:chart_with_upwards_trend: +37 Bytes| |packages/experience/src/hooks/use-session-storages.ts|:chart_with_upwards_trend: +303 Bytes| |packages/experience/src/pages/Continue/SetEmailOrPhone/index.tsx|:chart_with_upwards_trend: +273 Bytes| |packages/experience/src/pages/Continue/SetUsername/index.tsx|:chart_with_upwards_trend: +274 Bytes| |packages/experience/src/pages/ForgotPassword/ForgotPasswordForm/index.test.tsx|:chart_with_upwards_trend: +148 Bytes| |packages/experience/src/pages/ForgotPassword/ForgotPasswordForm/index.tsx|:chart_with_upwards_trend: +379 Bytes| |packages/experience/src/pages/ForgotPassword/index.test.tsx|:chart_with_upwards_trend: +541 Bytes| |packages/experience/src/pages/ForgotPassword/index.tsx|:chart_with_upwards_trend: +4 Bytes| |packages/experience/src/pages/Register/IdentifierRegisterForm/index.test.tsx|:chart_with_upwards_trend: +580 Bytes| |packages/experience/src/pages/Register/IdentifierRegisterForm/index.tsx|:chart_with_upwards_trend: +403 Bytes| |packages/experience/src/pages/ResetPassword/index.tsx|:chart_with_upwards_trend: +363 Bytes| |packages/experience/src/pages/SignIn/IdentifierSignInForm/index.test.tsx|:chart_with_upwards_trend: +722 Bytes| |packages/experience/src/pages/SignIn/IdentifierSignInForm/index.tsx|:chart_with_upwards_trend: +402 Bytes| |packages/experience/src/pages/SignIn/IdentifierSignInForm/use-on-submit.ts|:chart_with_upwards_trend: +139 Bytes| |packages/experience/src/pages/SignIn/PasswordSignInForm/index.tsx|:chart_with_upwards_trend: +272 Bytes| |packages/experience/src/pages/SignInPassword/PasswordForm/index.test.tsx|:chart_with_upwards_trend: +42 Bytes| |packages/experience/src/pages/SignInPassword/PasswordForm/index.tsx|:chart_with_upwards_trend: +266 Bytes| |packages/experience/src/pages/SignInPassword/index.test.tsx|:chart_with_upwards_trend: +320 Bytes| |packages/experience/src/pages/SignInPassword/index.tsx|:chart_with_upwards_trend: +26 Bytes| |packages/experience/src/pages/VerificationCode/index.test.tsx|:chart_with_upwards_trend: +516 Bytes| |packages/experience/src/pages/VerificationCode/index.tsx|:chart_with_upwards_trend: +29 Bytes| |packages/experience/src/types/guard.ts|:chart_with_upwards_trend: +69 Bytes|
wangsijie commented 4 days ago

CI failed