feat(frontend): implement auth access flow - #203
Open
Alexander-Noah wants to merge 3 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
/review |
Alexander-Noah
marked this pull request as ready for review
August 11, 2026 10:42
There was a problem hiding this comment.
Found two concrete issues: the default API prefix no longer matches the repository backend contract, and the lockfile introduces an undeclared third-party registry dependency.
Validation: npm ci and npm run check completed successfully.
Findings without inline locations
frontend/package-lock.json:451: [P2] Regenerate the lockfile against the repository registry. This lockfile introduces 275resolvedURLs fromregistry.npmmirror.com, although the previous lockfile usedregistry.npmjs.organd the repository has no.npmrcdeclaring a mirror. Becausenpm cifollows these pinned tarball URLs, CI and developer installs now depend on an undeclared third-party registry. Please regenerate with the official registry, or add an explicit reviewed registry policy if this mirror is intentional.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue
Closes #194
变更概述
实现登录注册页面、认证接口适配、表单逻辑复用、应用认证状态切换及相关测试。
依赖与测试配置
frontend/package.jsonreact-dom、react-native-web和@expo/metro-runtime,支持 Expo Web 运行。web、test:jest和test:vitest脚本。test脚本统一执行 Vitest 和 Jest。jest-expo测试预设。frontend/package-lock.json认证契约与接口适配
frontend/src/contracts/auth.tsAuthAccessRequest和AuthAccessResponse。AuthAccess。AuthAccessError隔离页面与具体 HTTP 实现。frontend/src/api/auth.tscreateAuthAccess。POST /auth/access提交用户名和密码。AbortController实现 15 秒请求超时。account_id和access_token必须为非空白字符串。expires_in必须为大于 0 的有限数字。AuthAccessError。frontend/src/infrastructure/network/client.tsApiRequest类型。ApiError,保留失败响应的 HTTP 状态码和响应体。ApiResponseError,区分成功响应中的无效 JSON。登录注册界面
frontend/src/screens/LoginScreen.tsxonAuthenticated向应用根组件传递响应。frontend/src/features/auth/presentation/useAuthAccessForm.tsfrontend/src/app/AppRoot.tsxfrontend/src/shared/ui/theme.tsxs、sm、lg、xl和xxl间距规格。自动化测试
frontend/src/api/auth.test.tsfrontend/src/infrastructure/network/client.test.ts/v1回退地址。ApiResponseError。frontend/src/features/auth/presentation/useAuthAccessForm.test.tsxfrontend/src/screens/LoginScreen.test.tsxfrontend/src/app/AppRoot.test.tsxfrontend/tests/integration/scheduleLocalRepository.test.ts变更原因
Issue #194 需要建立统一的前端认证入口。
本 PR 完成登录或创建账号的基础闭环,并将页面交互、表单状态、认证契约和 HTTP 请求适配分离,减少登录注册代码冗余。
只有完整有效的认证响应才能进入成功状态。业务错误、网络异常、无效响应和请求超时会转换为稳定的前端错误语义,并允许用户重新提交。
破坏性变更
无已知破坏性变更。
验证结果
本次不包含
loading、authenticated、unauthenticated状态机