Skip to content

fix(login): return real userId/nickname/redId in checkLoginStatus#3

Merged
sykuang merged 2 commits into
mainfrom
feature/login-real-userid
May 10, 2026
Merged

fix(login): return real userId/nickname/redId in checkLoginStatus#3
sykuang merged 2 commits into
mainfrom
feature/login-real-userid

Conversation

@sykuang

@sykuang sykuang commented May 10, 2026

Copy link
Copy Markdown
Owner

問題

checkLoginStatus 之前回傳 hardcoded username: 'rednote-mcp'(fallback 常數),無法識別真實登入帳號。

修復

  1. 從 sidebar Me 連結 /user/profile/<id> 解析真實 userID
  2. 同一個 page session 內呼叫 UserProfileAction.getMyProfileViaSidebar() 取 nickname / redId
  3. selfProfile 失敗則降級回只給 userID

驗證

{"isLoggedIn":true,"userId":"6246ed75...","nickname":"KK","redId":"4782487630","username":"KK"}

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

sykuang and others added 2 commits May 10, 2026 16:37
從 sidebar Me 連結解析真實 userID,取代 hardcoded fallback。
海外版 DOM 顯示 i18n "Me" 而非暱稱,故無法直接讀暱稱;
userID 至少能標識實際登入帳號,要看暱稱可呼叫 getMyProfile。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…s response

- check_login_status 未登入時回傳 hint 引導 LLM 呼叫 get_login_qrcode
- 強化 check_login_status / get_login_qrcode / search / list_feeds 的 description
- 讓 LLM 在被風控擋下時知道該先檢查登入並引導使用者掃碼

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sykuang sykuang merged commit 47c28e0 into main May 10, 2026
4 checks passed
@sykuang sykuang deleted the feature/login-real-userid branch May 10, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant