fix(1point3acres): detect login via current Discuz X user-panel markup#2145
Open
jiancui-research wants to merge 1 commit into
Open
fix(1point3acres): detect login via current Discuz X user-panel markup#2145jiancui-research wants to merge 1 commit into
jiancui-research wants to merge 1 commit into
Conversation
whoami and login-gated commands reported AUTH_REQUIRED for logged-in users because the identity probe only matched the legacy Discuz member panel (`#um .vwmy h4 a`), which the site no longer renders. - Match the current header username link (`a[title="访问我的空间"]`) while keeping the legacy selectors as fallbacks; the existing uid regex already handles the `space-uid-<uid>.html` href. - Also accept the logged-in header menu ids (`#g_upmine`, `#extcreditmenu`) as a login signal, so a future wording/markup change of the username link does not reintroduce a false AUTH_REQUIRED. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jiancui-research
force-pushed
the
fix/1point3acres-login-whoami-selector
branch
from
July 17, 2026 22:08
ac66a13 to
486e015
Compare
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.
Problem
opencli 1point3acres whoami(and login-gated commands) reportAUTH_REQUIREDfor users who are logged in. The site updated its headermarkup, so the identity probe's username selector no longer matches:
The logged-in user's own link is now:
Fix
Match the current username link, keeping the legacy selectors as fallback:
a[title="访问我的空间"]matches only the current user's own space link, andthe existing
uid[=-](\d+)regex already handles thespace-uid-<uid>.htmlhref.
Also treat the logged-in header menu ids (
#g_upmine,#extcreditmenu) asa login signal, so a future wording/markup change of the username link does
not reintroduce a false
AUTH_REQUIRED.Verification
whoamireturns the correctuser_id/usernamefor a logged-in session.Behavior is unchanged for the current site and for legacy markup — the new
selector and guard only add fallbacks, never remove existing ones.
🤖 Generated with Claude Code