Skip to content

Commit

Permalink
use isLocalhost instead of passing true
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed May 16, 2024
1 parent 7018bd7 commit 4270083
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions opentrons-ai-client/src/molecules/InputPrompt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { SendButton } from '../../atoms/SendButton'
import { preparedPromptAtom, chatDataAtom } from '../../resources/atoms'
import { useApiCall, useGetAccessToken } from '../../resources/hooks'
import { calcTextAreaHeight } from '../../resources/utils/utils'
import { calcTextAreaHeight, isLocalhost } from '../../resources/utils/utils'
import { END_POINT } from '../../resources/constants'

import type { AxiosRequestConfig } from 'axios'
Expand Down Expand Up @@ -63,7 +63,7 @@ export function InputPrompt(): JSX.Element {
message: userPrompt,
fake: false,
},
withCredentials: true,
withCredentials: isLocalhost(),
}
console.log('called')
await fetchData(config as AxiosRequestConfig)
Expand Down
3 changes: 2 additions & 1 deletion opentrons-ai-client/src/resources/hooks/useApiCall.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useState } from 'react'
import axios from 'axios'
import { isLocalhost } from '../utils/utils'

import type { AxiosRequestConfig } from 'axios'

Expand Down Expand Up @@ -28,7 +29,7 @@ export const useApiCall = <T>(): UseApiCallResult<T> => {
try {
const response = await axios.request<T>({
...config,
withCredentials: true,
withCredentials: isLocalhost(),
})
console.log(response)
setData(response.data)
Expand Down

0 comments on commit 4270083

Please sign in to comment.