bill92
01/29/2022, 8:00 AMts
import { useQuery } from "react-query";
import { useAxios } from "./useAxios";
export const useGetPatients = () => {
const { axios } = useAxios();
return useQuery(["patients"], () =>
axios.get("/patient", { withCredentials: true })
);
};
rp
01/29/2022, 8:00 AMrp
01/29/2022, 8:01 AM{ withCredentials: true }
. It get's added automatically.rp
01/29/2022, 8:01 AMbill92
01/29/2022, 8:01 AMts
SuperTokens.init({
appInfo: {
appName: "tlantli",
apiDomain: "http://localhost:5555",
websiteDomain: "http://localhost:3000",
apiBasePath: "/api/auth",
websiteBasePath: "/auth",
},
recipeList: [EmailPassword.init(), Session.init()],
});
bill92
01/29/2022, 8:01 AMts
AuthModule.forRoot({
connectionUri: 'https://try.supertokens.com',
appInfo: {
// Learn more about this on https://supertokens.com/docs/thirdpartyemailpassword/appinfo
appName: 'tlantli',
apiDomain: 'http://localhost:5555',
websiteDomain: 'http://localhost:3000',
apiBasePath: '/api/auth',
websiteBasePath: '/auth',
},
}),
rp
01/29/2022, 8:01 AMrp
01/29/2022, 8:02 AMbill92
01/29/2022, 8:02 AMrp
01/29/2022, 8:02 AMbill92
01/29/2022, 8:02 AMbill92
01/29/2022, 8:03 AMbill92
01/29/2022, 8:03 AMrp
01/29/2022, 8:03 AMbill92
01/29/2022, 8:04 AMbill92
01/29/2022, 8:04 AMrp
01/29/2022, 8:04 AMbill92
01/29/2022, 8:04 AMrp
01/29/2022, 8:05 AMrp
01/29/2022, 8:06 AMEmailPassword
recipe, but have copied from the thirdpartyemailpassword docs? I would suggest that you always use thirdpartyemailpassword
if seeing those docs.bill92
01/29/2022, 8:07 AMrp
01/29/2022, 8:11 AMFernando
01/29/2022, 11:07 AMrp
01/29/2022, 11:09 AMfetch
in getServerSideProps
runs on the server. Therefore, that fetch doesn't have interceptors applied to it. If you want to get the session info in getServerSideProps
, you can follow: https://supertokens.com/docs/thirdpartyemailpassword/nextjs/session-verification/in-ssrFernando
01/29/2022, 11:11 AMworkoutintheabstract
01/30/2022, 3:51 PMworkoutintheabstract
01/30/2022, 3:52 PMworkoutintheabstract
01/30/2022, 3:52 PMrp
01/30/2022, 3:53 PMrp
01/30/2022, 3:54 PM