benjick
10/30/2021, 4:53 PMrp
10/30/2021, 4:54 PMbenjick
10/31/2021, 4:24 PMNEXT_PUBLIC_APP_URL
and APP_URL
vars but I still get redirected to localhost. From the config file I put a console.log just to make sure:
js
const websiteDomain =
process.env.APP_URL ||
process.env.NEXT_PUBLIC_APP_URL ||
`http://localhost:${port}`;
console.log('websiteDomain', websiteDomain);
and it logs the correct url. Any ideas?rp
10/31/2021, 4:24 PMrp
10/31/2021, 4:26 PMrp
10/31/2021, 4:26 PMrp
10/31/2021, 4:26 PMbenjick
10/31/2021, 4:32 PMbenjick
10/31/2021, 4:32 PMrp
10/31/2021, 4:33 PMbenjick
10/31/2021, 4:34 PMbenjick
11/01/2021, 4:47 PMts
export let backendConfig = () => {
return {
framework: 'express',
But then when I use it with SuperTokensNode.init(SuperTokensConfig.backendConfig())
it says
> Type 'string' is not assignable to type 'TypeFramework'.
Diving into TypeFramework
shows me it should be fine:
export declare type TypeFramework = "express" | "fastify" | "hapi" | "loopback" | "koa" | "awsLambda";
Then I thought I need to define the return type of backendConfig
so I imported it like this: import { TypeFramework } from 'supertokens-node/lib/build/framework/types';
but then I get
> ... is not assignable to type '"awsLambda"'
I will just ts-ignore it for now, but thought I would mention it. Let me know if I should report an issue somewhererp
11/01/2021, 5:00 PMbenjick
11/01/2021, 6:31 PMrp
11/01/2021, 8:05 PMrp
11/01/2021, 8:06 PMbenjick
11/01/2021, 8:06 PMrp
11/01/2021, 8:07 PMrp
11/01/2021, 8:07 PMbenjick
11/01/2021, 8:08 PMuseSessionContext
without losing SSRrp
11/01/2021, 8:10 PMjs
import dynamic from 'next/dynamic'
import ThirdPartyEmailPassword from 'supertokens-auth-react/recipe/thirdpartyemailpassword'
const ThirdPartyEmailPasswordAuthNoSSR = dynamic(
new Promise((res) =>
res(ThirdPartyEmailPassword.ThirdPartyEmailPasswordAuth)
),
{ ssr: false }
)
export default function Home() {
return (
// we protect ProtectedPage by wrapping it
// with ThirdPartyEmailPasswordAuthNoSSR
<ThirdPartyEmailPasswordAuthNoSSR>
<ProtectedPage />
</ThirdPartyEmailPasswordAuthNoSSR>
)
}
rp
11/01/2021, 8:10 PMrp
11/01/2021, 8:11 PMThirdPartyEmailPasswordAuthNoSSR
only runs on the client side, and never during SSRbenjick
11/01/2021, 8:13 PMThirdPartyEmailPasswordAuth
has an extra div somewhere it gives me this misrender. I might dive into it laterrp
11/01/2021, 8:13 PMThirdPartyEmailPasswordAuth
is made with SSR in mind. I'm surprised that it doesn't throw an error..rp
11/01/2021, 8:14 PMtypeof window !== 'undefined'
rp
11/01/2021, 8:14 PMbenjick
11/01/2021, 8:15 PMrp
11/01/2021, 8:15 PMdynamic
feature provided by next?