I have an app that works properly on development environment, but once I deploy, the getProviders
method which is called at server side returns NULL to my component. If I visit https://MY_URL/api/auth/providers, I get the JSON I'm supposed to receive from getProviders
too
Here's the relevant code:
import { useEffect } from "react";
import { getProviders } from "next-auth/react";
const Estabelecimento = ({ abreviatura, providers }: any) => {
console.log(providers) // logs null
useEffect(() => {
console.log(providers); // also logs null
}, [providers]);
// rest of code...
}
export async function getServerSideProps(context: any) {
const abreviatura = context.params.estabelecimento;
const providers = await getProviders();
return {
props: {
abreviatura: abreviatura,
providers,
},
};
}
export default Estabelecimento;