Testing passwordless auth with SMS, I have an rq h...
# support-questions-legacy
b
Testing passwordless auth with SMS, I have an rq hook, for some reason it's not working if I don't include the
withCredentials
and set it to
true
. Is this expected?
Copy code
ts
import axios, { AxiosError } from "axios";
import { useQuery, UseQueryResult } from "react-query";
import { PatientResponse } from "../lib/types/patient";

const getPatients = async () => {
  const { data } = await axios.get<PatientResponse>(
    "http://localhost:5555/patient",
    {
      headers: {
        "Content-Type": "application/json",
      },
      withCredentials: true,
    }
  );
  return data;
};

export const useGetPatients = (): UseQueryResult<
  PatientResponse,
  AxiosError
> => {
  return useQuery(["patients"], getPatients);
};