fix onepassword router (#3105)

This commit is contained in:
LawyZheng
2025-08-05 23:33:08 +08:00
committed by GitHub
parent 00c9446023
commit 1e315e39cd
2 changed files with 8 additions and 9 deletions

View File

@@ -17,9 +17,9 @@ export function useOnePasswordToken() {
useQuery<OnePasswordTokenApiResponse>({
queryKey: ["onePasswordToken"],
queryFn: async () => {
const client = await getClient(credentialGetter);
const client = await getClient(credentialGetter, "sans-api-v1");
return await client
.get("/auth-tokens/onepassword")
.get("/credentials/onepassword/get")
.then((response) => response.data.token)
.catch(() => null);
},
@@ -27,9 +27,9 @@ export function useOnePasswordToken() {
const createOrUpdateTokenMutation = useMutation({
mutationFn: async (data: CreateOnePasswordTokenRequest) => {
const client = await getClient(credentialGetter);
const client = await getClient(credentialGetter, "sans-api-v1");
return await client
.post("/auth-tokens/onepassword", data)
.post("/credentials/onepassword/create", data)
.then((response) => response.data as CreateOnePasswordTokenResponse);
},
onSuccess: () => {