workoutintheabstract
02/01/2022, 9:55 PMbill92
02/01/2022, 10:26 PMwithCredentials
and set it to true
. Is this expected?
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);
};
bill92
02/01/2022, 10:26 PMrp
02/02/2022, 3:49 AMrp
02/02/2022, 3:50 AMrp
02/02/2022, 3:50 AMbill92
02/02/2022, 4:00 AMrp
02/02/2022, 4:01 AMbill92
02/02/2022, 4:09 AMbill92
02/02/2022, 4:10 AMhttp://localhost:3567/hello
, "Hello" is returned, but whenever I try to start passwordless auth I get the error on react that says, Something went wrong. Please try again
rp
02/02/2022, 4:14 AMbill92
02/02/2022, 4:15 AMError: No SuperTokens core available to query
bill92
02/02/2022, 4:22 AMServer ready
Error: No SuperTokens core available to query
at Querier.<anonymous> (/Users/gmwill934/Documents/gmwill934/supertokens-otp/api/node_modules/supertokens-node/lib/build/querier.js:225:27)
at Generator.next (<anonymous>)
at /Users/gmwill934/Documents/gmwill934/supertokens-otp/api/node_modules/supertokens-node/lib/build/querier.js:30:75
at new Promise (<anonymous>)
at __awaiter (/Users/gmwill934/Documents/gmwill934/supertokens-otp/api/node_modules/supertokens-node/lib/build/querier.js:12:16)
at Querier.sendRequestHelper (/Users/gmwill934/Documents/gmwill934/supertokens-otp/api/node_modules/supertokens-node/lib/build/querier.js:218:13)
at Querier.<anonymous> (/Users/gmwill934/Documents/gmwill934/supertokens-otp/api/node_modules/supertokens-node/lib/build/querier.js:245:43)
at Generator.throw (<anonymous>)
at rejected (/Users/gmwill934/Documents/gmwill934/supertokens-otp/api/node_modules/supertokens-node/lib/build/querier.js:22:44)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
bill92
02/02/2022, 4:22 AMrp
02/02/2022, 4:22 AMbill92
02/02/2022, 4:22 AMbill92
02/02/2022, 4:22 AMrp
02/02/2022, 4:22 AMrp
02/02/2022, 4:23 AMrp
02/02/2022, 4:23 AMbill92
02/02/2022, 4:24 AMbill92
02/02/2022, 4:24 AMbill92
02/02/2022, 4:25 AMrp
02/02/2022, 4:25 AMbill92
02/02/2022, 5:18 AMversion: '3.9'
services:
api:
build: .
ports:
- '5555:5555'
depends_on:
- supertokens
supertokens:
image: registry.supertokens.io/supertokens/supertokens-postgresql
bill92
02/02/2022, 5:18 AMrp
02/02/2022, 5:18 AMbill92
02/02/2022, 5:19 AMexport const InitializeSupertokens = () =>
SuperTokens.init({
framework: 'express',
supertokens: {
connectionURI: 'supertokens:3567',
},
appInfo: {
appName: 'tlantli',
apiDomain: process.env.API_URL as string,
websiteDomain: process.env.WEB_URL as string,
apiBasePath: process.env.AUTH_PATH as string,
websiteBasePath: process.env.AUTH_PATH as string,
},
recipeList: [
Passwordless.init({
flowType: 'USER_INPUT_CODE',
contactMethod: 'PHONE',
createAndSendCustomTextMessage: async (input) => {
const { phoneNumber, userInputCode } = input;
client.messages.create({
body: userInputCode?.toString(),
from: TWILIO_PHONE_NUMBER,
to: phoneNumber,
});
},
}),
Session.init(),
],
});
bill92
02/02/2022, 5:19 AMbill92
02/02/2022, 5:19 AM