Skip to content

Commit f9ff759

Browse files
author
CodeBuddy Attribution Bot
committed
fix(attribution): auth-web-cloudbase Skill 文档 API 流程与测试期望不匹配,且未指引正确环境 ID (issue_mnruyfxz_151yd0)
1 parent a185c3a commit f9ff759

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ Use the same CDN address as `web-development`. Prefer npm installation in modern
6565

6666
## Prerequisites
6767

68-
- Automatically use `auth-tool-cloudbase` to check app-side auth readiness via `queryAppAuth` / `manageAppAuth`, then get the `publishable key` and configure login methods.
68+
- Use `envQuery(action="info")` or `envQuery(action="list")` to confirm the real CloudBase environment ID before any auth setup. Do not leave the placeholder `env` literal in code, console URLs, or tool calls.
69+
- If the current MCP session is not already bound to that environment, call `auth(action="set_env", envId="<actual-env-id>")` first so `queryAppAuth` / `manageAppAuth` operate on the correct app.
70+
- Automatically use `auth-tool-cloudbase` to check app-side auth readiness: `queryAppAuth(action="getLoginConfig")` for login methods, `manageAppAuth(action="patchLoginStrategy")` when a required method is off, and `queryAppAuth(action="getPublishableKey")` or `manageAppAuth(action="ensurePublishableKey")` for the publishable key.
6971
- If `auth-tool-cloudbase` failed, let user go to `https://tcb.cloud.tencent.com/dev?envId={env}#/env/apikey` to get `publishable key` and `https://tcb.cloud.tencent.com/dev?envId={env}#/identity/login-manage` to set up login methods
7072

7173
### Parameter map
@@ -88,9 +90,9 @@ Use the same CDN address as `web-development`. Prefer npm installation in modern
8890
import cloudbase from '@cloudbase/js-sdk'
8991

9092
const app = cloudbase.init({
91-
env: `env`, // CloudBase environment ID
93+
env: `env`, // replace with the real CloudBase environment ID from envQuery
9294
region: `region`, // CloudBase environment Region, default 'ap-shanghai'
93-
accessKey: 'publishable key', // required, get from auth-tool-cloudbase
95+
accessKey: 'publishable key', // get via queryAppAuth(getPublishableKey) or manageAppAuth(ensurePublishableKey)
9496
auth: { detectSessionInUrl: true }, // required
9597
})
9698

@@ -179,7 +181,7 @@ const handleSendCode = async () => {
179181
try {
180182
const { data, error } = await auth.signUp({
181183
email,
182-
name: username || email.split('@')[0],
184+
nickname: username || email.split('@')[0],
183185
})
184186
if (error) throw error
185187
setSignUpData(data)
@@ -192,11 +194,7 @@ const handleRegister = async () => {
192194
try {
193195
if (!signUpData?.verifyOtp) throw new Error('Please send the code first')
194196

195-
const { error } = await signUpData.verifyOtp({
196-
email,
197-
token: code,
198-
type: 'signup',
199-
})
197+
const { error } = await signUpData.verifyOtp({ token: code })
200198
if (error) throw error
201199
} catch (error) {
202200
console.error('Failed to complete sign-up', error)

0 commit comments

Comments
 (0)