docs(auth-web): add MISFIELD gotcha about user.id vs user.uid#688
docs(auth-web): add MISFIELD gotcha about user.id vs user.uid#688
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82613bbef4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - Using `signInWithEmailAndPassword` or `signUpWithEmailAndPassword` for username-style accounts such as `admin` and `editor`. | ||
| - Keeping the login or register account input as `type="email"` when the task explicitly says the account identifier is a plain username string. | ||
| - Starting implementation before calling `queryAppAuth(action="getLoginConfig")` and enabling `usernamePassword` when it is still off. | ||
| - **MISFIELD: `signInWithPassword` and `register` return `data.user.id` as the uid; `getLoginState` exposes the uid via `loginState.uid`. Do NOT write `user.uid` — it does not exist on the user object.** |
There was a problem hiding this comment.
Use canonical
signUp API name in MISFIELD note
This new warning introduces a backticked register identifier even though this skill consistently documents registration with auth.signUp(...) (and does not define an auth.register API). Because this file is used as generation guidance, presenting register as an API-like name can lead generated frontend code to call a nonexistent method and fail at runtime (auth.register is not a function) in username/password registration flows.
Useful? React with 👍 / 👎.
Problem
Agent repeatedly writes
user.uidaftersignInWithPassword/getLoginState, but the correct field isuser.id(uid is exposed vialoginState.uid). This causes auth checks to fail and redirect loops in cases likecms-scaffold.Fix
Add a MISFIELD gotcha in
auth-web-cloudbaseskill to explicitly warn againstuser.uid.Related
application-js-react-cloudbase-cms-scaffoldissue_cms_scaffold_uid_1777437510250