rp
12/27/2022, 4:14 AMrajkamalnehul
12/27/2022, 6:14 AMrp
12/27/2022, 6:29 AMiqrammm
12/27/2022, 6:34 AMAccess to fetch at 'http://localhost:8086/auth/signin' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled
Front end: React/create-react-app
Backend: Fastify.
I've read some other thread that I need to register cors first before supertokens.init() but this wouldn't work because of
getInstanceOrThrowError().getAllCORSHeaders()
will throw error if I initialize it before.
Tried hardcoding my cors plugin like this since for emailpassword only two extra headers anyway.
module.exports = fp(async function (fastify, opts, next) {
await fastify.register(cors, {
origin: 'http://localhost:3000',
allowedHeaders: ['content-type', 'rid', 'fdi-version'],
methods: ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'HEAD'],
credentials: true,
});
});
I feel like I have followed the documentation properly. What am I missing here exactly?rp
12/27/2022, 7:28 AMNoodles
12/27/2022, 9:16 AMshrey07
12/27/2022, 1:17 PMrp
12/27/2022, 1:42 PMmathewpregasen
12/27/2022, 4:40 PMmathewpregasen
12/27/2022, 4:41 PMrp
12/27/2022, 5:11 PMhwihwi
12/27/2022, 6:35 PMRoy R
12/27/2022, 9:42 PMRoy R
12/27/2022, 9:44 PM/src/infra/lambdas/.../node_modules/supertokens-node/lib/build/querier.js:225
throw Error("No SuperTokens core available to query");
^
Error: No SuperTokens core available to query
at Querier.<anonymous> (/src/infra/lambdas/.../node_modules/supertokens-node/lib/build/querier.js:225:27)
Roy R
12/27/2022, 9:44 PMAdis
12/27/2022, 10:33 PMsupertokens-auth-react
package that appears to be causing it. Any info or advice to clean these errors would be super helpful 😊
Additionally here is the inline error
Type '{ class: string; }' is not assignable to type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'.
Object literal may only specify known properties, and 'class' does not exist in type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'.ts(2322)
index.d.ts(3176, 13): The expected type comes from property 'div' which is declared here on type 'IntrinsicElements'
sullof
12/27/2022, 11:17 PMsullof
12/27/2022, 11:46 PMError 400: redirect_uri_mismatch
rp
12/28/2022, 5:25 AMrp
12/28/2022, 5:26 AMrp
12/28/2022, 5:27 AManujchhabria
12/28/2022, 7:00 AManujchhabria
12/28/2022, 7:01 AManujchhabria
12/28/2022, 7:01 AMabhisheksinghkapoor
12/28/2022, 8:10 AMrohitkdn
12/28/2022, 9:38 AMrp
12/28/2022, 10:12 AMLKz
12/28/2022, 2:41 PMrp
12/28/2022, 3:07 PMcodingtomato
12/28/2022, 5:53 PM