Skip to content

fix: update LDAP login request to handle accessToken as query parameter - #7934

Merged
wxg0103 merged 1 commit into
v3from
pr@v3@fix_ldap_login
Nov 16, 2026
Merged

wxg0103 merged 1 commit into
v3from
pr@v3@fix_ldap_login

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

fix: update LDAP login request to handle accessToken as query parameter

Comment thread ui/src/api/chat/auth.ts
params: accessToken ? { accessToken } : undefined,
headers: getSavedTokenHeaders(savedToken),
}),
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issues / Observations:

  1. API contract change (breaking): The endpoint path changed from /auth/ldap/login/${accessToken} to a fixed /auth/ldap/login with accessToken moved into query params. Ensure the backend actually supports the query-param variant; otherwise this is a behavioral regression.

  2. Potential inconsistency with postLogin: If the sibling postLogin still uses the path-segment pattern, the two login functions now diverge in how they pass accessToken. Verify this divergence is intentional.

  3. Undefined params: Passing params: undefined is generally harmless in axios, but some wrappers/interceptors may not handle it consistently. Prefer building the config object conditionally or letting the library ignore it (usually fine).

  4. Semantic/security concern: Moving an access token from path to query string does not materially change exposure (both are logged), but query strings are more commonly logged by proxies/servers. Confirm logging policies.

  5. Type safety: No explicit typing on the new params object; minor, but consider typing for consistency.

Optimization suggestion: Use a spread/conditional to avoid passing undefined:

request.post<ApiResponse<ChatLoginResponse>>('/auth/ldap/login', loginRequest, {
  ...(accessToken ? { params: { accessToken } } : {}),
  headers: getSavedTokenHeaders(savedToken),
})

Also add/update a unit test asserting the correct URL + params for both cases (with and without accessToken).

@wxg0103
wxg0103 merged commit 041e0a7 into v3 Nov 16, 2026
3 of 4 checks passed
@wxg0103
wxg0103 deleted the pr@v3@fix_ldap_login branch November 16, 2026 07:07
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.

2 participants