Skip to content

Commit 39fb481

Browse files
author
CodeBuddy Attribution Bot
committed
fix(attribution): auth-web-cloudbase Skill 邮箱注册 API 流程说明不清晰 (issue_mnouau2z_bk9am7)
1 parent 65c585d commit 39fb481

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

config/source/skills/auth-tool/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Parameter mapping for downstream Web auth code:
130130
- `queryAppAuth(action="getLoginConfig")` and `manageAppAuth(action="patchLoginStrategy")` return `sdkStyle: "supabase-like"` plus `sdkHints`; treat that as the preferred frontend-auth calling guide
131131
- `PhoneNumberLogin` controls phone OTP flows used by `auth-web` `auth.signInWithOtp({ phone })` and `auth.signUp({ phone })`
132132
- `EmailLogin` controls email OTP flows used by `auth-web` `auth.signInWithOtp({ email })` and `auth.signUp({ email })`
133+
- Email and phone signup complete through OTP verification. After `auth.signUp({ email|phone, ... })`, continue with the returned `verifyOtp({ token })`
133134
- `UserNameLogin` controls username/password Web auth flows used by `auth-web` `auth.signUp({ username, password })` and `auth.signInWithPassword({ username, password })`
134135
- If the account identifier is a plain username string, do not route it through email-only helpers such as `signInWithEmailAndPassword`
135136
- `UserNameLogin` also enables the broader password-login surface exposed by `auth.signInWithPassword({ username|email|phone, password })`
@@ -212,6 +213,7 @@ Email has two layers of configuration:
212213
- `ModifyLoginConfig.EmailLogin`: controls whether email/password login is enabled
213214
- `ModifyProvider(Id="email")`: controls the email sender channel and SMTP configuration
214215
- In Web auth code, this maps to `auth.signInWithOtp({ email })` and `auth.signUp({ email })`
216+
- `auth.signUp({ email })` is an email OTP registration step, not an `email + password` signup payload; finish the flow with `verifyOtp({ token })`
215217

216218
Preferred MCP tool path:
217219

config/source/skills/auth-web/SKILL.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Use the same CDN address as `web-development`. Prefer npm installation in modern
7676
- `auth.signInWithOtp({ phone })` and `auth.signUp({ phone })` use the phone number in a `phone` field, not `phone_number`
7777
- `auth.signInWithOtp({ email })` and `auth.signUp({ email })` use `email`
7878
- `auth.signUp({ username, password })` and `auth.signInWithPassword({ username, password })` are the canonical username/password Web auth path
79+
- Email and phone registration are OTP flows: call `auth.signUp({ email|phone, ... })`, then complete the signup with the returned `data.verifyOtp({ token })`
80+
- Do not describe email registration as `auth.signUp({ email, password })`; for email-based password login, use `auth.signInWithPassword({ email, password })` after the account already exists
7981
- If the task gives accounts like `admin`, `editor`, or another plain string without `@`, treat it as a username-style identifier rather than an email address
8082
- `verifyOtp({ token })` expects the SMS or email code in `token`
8183
- `accessKey` is the publishable key from `queryAppAuth` / `manageAppAuth` via `auth-tool-cloudbase`, not a secret key
@@ -128,6 +130,8 @@ const phoneLogin = await auth.signInWithPassword({ phone: '13800138000', passwor
128130
- For username-style account systems, use username/password registration directly
129131
- Do not switch to email OTP or phone OTP unless the task explicitly says the account identifier is an email address or phone number
130132
- When the task uses plain usernames such as `admin`, `editor`, or `user01`, the canonical form code is `auth.signUp({ username, password })`
133+
- Email and phone signup are verification-code flows. Send the code with `auth.signUp(...)`, then call the returned `verifyOtp({ token })` to finish registration
134+
- Do not write email registration as `auth.signUp({ email, password })`; email/password is a sign-in flow, not the signup payload shown here
131135
```js
132136
// Username + Password
133137
const usernameSignUp = await auth.signUp({
@@ -136,15 +140,13 @@ const usernameSignUp = await auth.signUp({
136140
nickname: 'User',
137141
})
138142

139-
// Email Otp
143+
// Email OTP signup.
140144
// Use only when the task explicitly requires email addresses.
141-
// Email Otp
142145
const emailSignUp = await auth.signUp({ email: 'new@example.com', nickname: 'User' })
143146
const emailVerifyResult = await emailSignUp.data.verifyOtp({ token: '123456' })
144147

145-
// Phone Otp
148+
// Phone OTP signup.
146149
// Use only when the task explicitly requires phone numbers.
147-
// Phone Otp
148150
const phoneSignUp = await auth.signUp({ phone: '13800138000', nickname: 'User' })
149151
const phoneVerifyResult = await phoneSignUp.data.verifyOtp({ token: '123456' })
150152
```

mcp/src/tools/app-auth.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ describe("app auth tools", () => {
6767
phoneOtp: "auth.signInWithOtp({ phone })",
6868
emailOtp: "auth.signInWithOtp({ email })",
6969
password: "auth.signInWithPassword({ username|email|phone, password })",
70-
signup: "auth.signUp({ phone|email, ... })",
71-
verifyOtp: "verifyOtp({ token })",
70+
signup: "auth.signUp({ username, password }) or auth.signUp({ phone|email, ... })",
71+
verifyOtp: "verifyOtp({ token }) for phone/email OTP signup or login",
7272
anonymous: "auth.signInAnonymously()",
7373
};
7474

mcp/src/tools/app-auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const SUPABASE_LIKE_SDK_HINTS = {
3636
phoneOtp: "auth.signInWithOtp({ phone })",
3737
emailOtp: "auth.signInWithOtp({ email })",
3838
password: "auth.signInWithPassword({ username|email|phone, password })",
39-
signup: "auth.signUp({ phone|email, ... })",
40-
verifyOtp: "verifyOtp({ token })",
39+
signup: "auth.signUp({ username, password }) or auth.signUp({ phone|email, ... })",
40+
verifyOtp: "verifyOtp({ token }) for phone/email OTP signup or login",
4141
anonymous: "auth.signInAnonymously()",
4242
} as const;
4343

0 commit comments

Comments
 (0)