-
Notifications
You must be signed in to change notification settings - Fork 540
fix: correct env var lookup for Together AI provider in vault middleware #4564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6eaecdd
445fc3f
585c6ad
c9d112d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -56,3 +56,17 @@ export const changePassword = async (payload: { | |||||||||||||||||||||||||||||||||||||||||||||||
| body: JSON.stringify(payload), | ||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||
| * Generate a password reset link for a user (admin action). | ||||||||||||||||||||||||||||||||||||||||||||||||
| * Returns the reset password link string. | ||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||
| export const resetPassword = async (userId: string): Promise<string> => { | ||||||||||||||||||||||||||||||||||||||||||||||||
| const base = getBaseUrl() | ||||||||||||||||||||||||||||||||||||||||||||||||
| const url = new URL("api/profile/reset-password", base) | ||||||||||||||||||||||||||||||||||||||||||||||||
| url.searchParams.set("user_id", userId) | ||||||||||||||||||||||||||||||||||||||||||||||||
| const data = await fetchJson<string>(url, { | ||||||||||||||||||||||||||||||||||||||||||||||||
| method: "POST", | ||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||
| return data | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+60
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use Fern-generated client instead of raw fetchJson. As per coding guidelines, all new frontend API code must go through the Fern-generated client, not raw fetch/axios. The Fern-generated client already provides a reset password method that handles this endpoint with proper typing and error handling. ♻️ Recommended refactor to use Fern-generated client-export const resetPassword = async (userId: string): Promise<string> => {
- const base = getBaseUrl()
- const url = new URL("api/profile/reset-password", base)
- url.searchParams.set("user_id", userId)
- const data = await fetchJson<string>(url, {
- method: "POST",
- })
- return data
-}
+export const resetPassword = async (userId: string): Promise<string> => {
+ const client = getAgentaSdkClient({host: getAgentaApiUrl()})
+ const response = await client.users.resetUserPassword({user_id: userId})
+ // Extract the reset link from the response based on the actual API contract
+ return response as unknown as string
+}Note: You may need to adjust the return type handling based on the actual Fern client response structure. Based on learnings, the Fern-generated client at 📝 Committable suggestion
Suggested change
Source: Coding guidelines |
||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Run
ruff formatandruff check --fixbefore committing.As per coding guidelines, Python changes in
{api,sdk,sdks}/**/*.pymust be formatted and linted with ruff.Source: Coding guidelines